fix: convert the Workspace class to an ES6 class (#5977)

* fix: run conversion script on workspace

* fix: cleanup from conversion script

* fix: make debug build happy

* fix: tests

* fix: format

* fix: format
This commit is contained in:
Beka Westberg
2022-03-16 13:22:03 -07:00
committed by GitHub
parent a65b895002
commit e2eaebec47
16 changed files with 811 additions and 779 deletions

View File

@@ -22,6 +22,7 @@ const eventUtils = goog.require('Blockly.Events.utils');
const registry = goog.require('Blockly.registry');
// eslint-disable-next-line no-unused-vars
const {Workspace} = goog.require('Blockly.Workspace');
const {WorkspaceSvg} = goog.require('Blockly.WorkspaceSvg');
/**
@@ -70,7 +71,7 @@ const load = function(state, workspace, {recordUndo = false} = {}) {
}
dom.startTextWidthCache();
if (workspace.setResizesEnabled) {
if (workspace instanceof WorkspaceSvg) {
workspace.setResizesEnabled(false);
}
@@ -89,7 +90,7 @@ const load = function(state, workspace, {recordUndo = false} = {}) {
}
}
if (workspace.setResizesEnabled) {
if (workspace instanceof WorkspaceSvg) {
workspace.setResizesEnabled(true);
}
dom.stopTextWidthCache();