Update uses of mainWorkspace in core

This commit is contained in:
Rachel Fenichel
2021-07-28 20:51:46 -07:00
parent a86f1484d2
commit 2e30bbe7ce
8 changed files with 22 additions and 18 deletions

View File

@@ -14,6 +14,7 @@ goog.provide('Blockly.inject');
goog.require('Blockly.BlockDragSurfaceSvg');
goog.require('Blockly.browserEvents');
goog.require('Blockly.common');
goog.require('Blockly.Css');
goog.require('Blockly.DropDownDiv');
goog.require('Blockly.Events');
@@ -77,12 +78,12 @@ Blockly.inject = function(container, opt_options) {
Blockly.init_(workspace);
// Keep focus on the first workspace so entering keyboard navigation looks correct.
Blockly.mainWorkspace = workspace;
Blockly.common.setMainWorkspace(workspace);
Blockly.svgResize(workspace);
subContainer.addEventListener('focusin', function() {
Blockly.mainWorkspace = workspace;
Blockly.common.setMainWorkspace(workspace);
});
return workspace;
@@ -439,7 +440,7 @@ Blockly.inject.bindDocumentEvents_ = function() {
window, 'orientationchange', document, function() {
// TODO (#397): Fix for multiple Blockly workspaces.
Blockly.svgResize(/** @type {!Blockly.WorkspaceSvg} */
(Blockly.getMainWorkspace()));
(Blockly.common.getMainWorkspace()));
});
}
}