diff --git a/core/workspace_dragger.js b/core/workspace_dragger.js index a0a6eef16..90aade9f3 100644 --- a/core/workspace_dragger.js +++ b/core/workspace_dragger.js @@ -10,7 +10,8 @@ */ 'use strict'; -goog.provide('Blockly.WorkspaceDragger'); +goog.module('Blockly.WorkspaceDragger'); +goog.module.declareLegacyNamespace(); goog.require('Blockly.utils.Coordinate'); @@ -26,7 +27,7 @@ goog.requireType('Blockly.WorkspaceSvg'); * @param {!Blockly.WorkspaceSvg} workspace The workspace to drag. * @constructor */ -Blockly.WorkspaceDragger = function(workspace) { +const WorkspaceDragger = function(workspace) { /** * @type {!Blockly.WorkspaceSvg} * @private @@ -62,7 +63,7 @@ Blockly.WorkspaceDragger = function(workspace) { * @package * @suppress {checkTypes} */ -Blockly.WorkspaceDragger.prototype.dispose = function() { +WorkspaceDragger.prototype.dispose = function() { this.workspace_ = null; }; @@ -70,7 +71,7 @@ Blockly.WorkspaceDragger.prototype.dispose = function() { * Start dragging the workspace. * @package */ -Blockly.WorkspaceDragger.prototype.startDrag = function() { +WorkspaceDragger.prototype.startDrag = function() { if (Blockly.selected) { Blockly.selected.unselect(); } @@ -83,7 +84,7 @@ Blockly.WorkspaceDragger.prototype.startDrag = function() { * moved from the position at the start of the drag, in pixel coordinates. * @package */ -Blockly.WorkspaceDragger.prototype.endDrag = function(currentDragDeltaXY) { +WorkspaceDragger.prototype.endDrag = function(currentDragDeltaXY) { // Make sure everything is up to date. this.drag(currentDragDeltaXY); this.workspace_.resetDragSurface(); @@ -95,7 +96,7 @@ Blockly.WorkspaceDragger.prototype.endDrag = function(currentDragDeltaXY) { * moved from the position at the start of the drag, in pixel coordinates. * @package */ -Blockly.WorkspaceDragger.prototype.drag = function(currentDragDeltaXY) { +WorkspaceDragger.prototype.drag = function(currentDragDeltaXY) { const newXY = Blockly.utils.Coordinate.sum(this.startScrollXY_, currentDragDeltaXY); if (this.horizontalScrollEnabled_ && this.verticalScrollEnabled_) { @@ -108,3 +109,5 @@ Blockly.WorkspaceDragger.prototype.drag = function(currentDragDeltaXY) { throw new TypeError('Invalid state.'); } }; + +exports = WorkspaceDragger; diff --git a/tests/deps.js b/tests/deps.js index 64c88377b..bd2e81f5b 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -208,7 +208,7 @@ goog.addDependency('../../core/workspace_audio.js', ['Blockly.WorkspaceAudio'], goog.addDependency('../../core/workspace_comment.js', ['Blockly.WorkspaceComment'], ['Blockly.Events', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/workspace_comment_svg.js', ['Blockly.WorkspaceCommentSvg'], ['Blockly', 'Blockly.ContextMenu', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Selected', 'Blockly.IBoundedElement', 'Blockly.IBubble', 'Blockly.ICopyable', 'Blockly.Touch', 'Blockly.WorkspaceComment', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/workspace_drag_surface_svg.js', ['Blockly.WorkspaceDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.dom']); -goog.addDependency('../../core/workspace_dragger.js', ['Blockly.WorkspaceDragger'], ['Blockly.utils.Coordinate']); +goog.addDependency('../../core/workspace_dragger.js', ['Blockly.WorkspaceDragger'], ['Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ComponentManager', 'Blockly.ConnectionDB', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.ThemeChange', 'Blockly.Events.ViewportChange', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.IASTNodeLocationSvg', 'Blockly.MarkerManager', 'Blockly.MetricsManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.TouchGesture', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Metrics', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es5'}); goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events', 'Blockly.inputTypes', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.xml']); goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.ComponentManager', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.Click', 'Blockly.IPositionable', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.uiPosition', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'});