From d0559a5eeb972b434647fbe3980e20be244924b7 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Thu, 28 Feb 2019 15:43:52 -0800 Subject: [PATCH] Fixed scroll event binding to work with multiple workspaces. --- core/inject.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/inject.js b/core/inject.js index 7a89b8cb9..b4a1e3539 100644 --- a/core/inject.js +++ b/core/inject.js @@ -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.