mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
refactor: Move Blockly.svgResize to Blockly.common (#5485)
* refactor: Move Blockly.svgResize to Blockly.common * fix formatting and deps
This commit is contained in:
committed by
GitHub
parent
3bac582edb
commit
6dbc534dcc
@@ -80,7 +80,7 @@ const inject = function(container, opt_options) {
|
||||
// correct.
|
||||
common.setMainWorkspace(workspace);
|
||||
|
||||
Blockly.svgResize(workspace);
|
||||
common.svgResize(workspace);
|
||||
|
||||
subContainer.addEventListener('focusin', function() {
|
||||
common.setMainWorkspace(workspace);
|
||||
@@ -188,7 +188,7 @@ const createMainWorkspace = function(
|
||||
bumpObjects.bumpIntoBoundsHandler(mainWorkspace));
|
||||
|
||||
// The SVG is now fully assembled.
|
||||
Blockly.svgResize(mainWorkspace);
|
||||
common.svgResize(mainWorkspace);
|
||||
WidgetDiv.createDom();
|
||||
DropDownDiv.createDom();
|
||||
Tooltip.createDom();
|
||||
@@ -215,7 +215,7 @@ const init = function(mainWorkspace) {
|
||||
const workspaceResizeHandler =
|
||||
browserEvents.conditionalBind(window, 'resize', null, function() {
|
||||
mainWorkspace.hideChaff(true);
|
||||
Blockly.svgResize(mainWorkspace);
|
||||
common.svgResize(mainWorkspace);
|
||||
goog.module.get('Blockly.bumpObjects')
|
||||
.bumpTopObjectsIntoBounds(mainWorkspace);
|
||||
});
|
||||
@@ -324,8 +324,8 @@ const bindDocumentEvents = function() {
|
||||
browserEvents.conditionalBind(
|
||||
window, 'orientationchange', document, function() {
|
||||
// TODO (#397): Fix for multiple Blockly workspaces.
|
||||
Blockly.svgResize(/** @type {!WorkspaceSvg} */
|
||||
(common.getMainWorkspace()));
|
||||
common.svgResize(/** @type {!WorkspaceSvg} */
|
||||
(common.getMainWorkspace()));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user