Merge pull request #2323 from BeksOmega/fixes/ScrollBinding

Fixed Scroll Event Binding to Work with Multiple Workspaces
This commit is contained in:
Rachel Fenichel
2019-02-28 16:44:18 -08:00
committed by GitHub

View File

@@ -441,9 +441,14 @@ Blockly.inject.bindDocumentEvents_ = function() {
Blockly.hideChaff();
Blockly.Touch.clearTouchIdentifier(); // Don't block future drags.
});
Blockly.bindEventWithChecks_(document, 'scroll', null,
Blockly.mainWorkspace.updateInverseScreenCTM
.bind(Blockly.mainWorkspace));
Blockly.bindEventWithChecks_(document, 'scroll', null, function() {
for (var workspaceId in Blockly.Workspace.WorkspaceDB_) {
var workspace = Blockly.Workspace.WorkspaceDB_[workspaceId];
if (workspace.updateInverseScreenCTM) {
workspace.updateInverseScreenCTM();
}
}
});
Blockly.bindEventWithChecks_(document, 'keydown', null, Blockly.onKeyDown_);
// longStop needs to run to stop the context menu from showing up. It
// should run regardless of what other touch event handlers have run.