mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user