mirror of
https://github.com/google/blockly.git
synced 2026-03-12 00:00:12 +01:00
Emit workspace click event (#3956)
This commit is contained in:
@@ -651,11 +651,25 @@ Blockly.Gesture.prototype.handleWsStart = function(e, ws) {
|
||||
this.setStartWorkspace_(ws);
|
||||
this.mostRecentEvent_ = e;
|
||||
this.doStart(e);
|
||||
if (!this.startBlock_ && !this.startBubble_) {
|
||||
this.fireWorkspaceClick_(ws);
|
||||
}
|
||||
if (this.startWorkspace_.keyboardAccessibilityMode) {
|
||||
Blockly.navigation.setState(Blockly.navigation.STATE_WS);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Fires a workspace click event.
|
||||
* @param {!Blockly.WorkspaceSvg} ws The workspace that a user clicks on.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Gesture.prototype.fireWorkspaceClick_ = function(ws) {
|
||||
var clickEvent = new Blockly.Events.Ui(null, "workspaceClick", null, null);
|
||||
clickEvent.workspaceId = ws.id;
|
||||
Blockly.Events.fire(clickEvent);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle a mousedown/touchstart event on a flyout.
|
||||
* @param {!Event} e A mouse down or touch start event.
|
||||
|
||||
Reference in New Issue
Block a user