Emit workspace click event (#3956)

This commit is contained in:
alschmiedt
2020-06-11 10:21:55 -07:00
committed by GitHub
parent b1211f6dd2
commit 0272401dcb

View File

@@ -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.