diff --git a/core/flyout_button.js b/core/flyout_button.js index 47d8a973e..700933a06 100644 --- a/core/flyout_button.js +++ b/core/flyout_button.js @@ -48,7 +48,7 @@ Blockly.FlyoutButton = function(workspace, targetWorkspace, xml, isLabel) { this.workspace_ = workspace; /** - * @type {!Blockly.Workspace} + * @type {!Blockly.WorkspaceSvg} * @private */ this.targetWorkspace_ = targetWorkspace; @@ -234,13 +234,10 @@ Blockly.FlyoutButton.prototype.dispose = function() { } if (this.svgGroup_) { Blockly.utils.dom.removeNode(this.svgGroup_); - this.svgGroup_ = null; } if (this.svgText_) { this.workspace_.getThemeManager().unsubscribe(this.svgText_); } - this.workspace_ = null; - this.targetWorkspace_ = null; }; /** diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 87b5610d0..fd0de41bb 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -921,7 +921,7 @@ Blockly.WorkspaceSvg.prototype.updateScreenCalculationsIfScrolled = /** * Get the SVG element that forms the drawing surface. - * @return {!Element} SVG element. + * @return {!SVGElement} SVG element. */ Blockly.WorkspaceSvg.prototype.getCanvas = function() { return this.svgBlockCanvas_; @@ -937,7 +937,7 @@ Blockly.WorkspaceSvg.prototype.getBubbleCanvas = function() { /** * Get the SVG element that contains this workspace. - * @return {Element} SVG element. + * @return {SVGElement} SVG element. */ Blockly.WorkspaceSvg.prototype.getParentSvg = function() { if (this.cachedParentSvg_) { @@ -949,7 +949,7 @@ Blockly.WorkspaceSvg.prototype.getParentSvg = function() { this.cachedParentSvg_ = element; return element; } - element = element.parentNode; + element = /** @type {!SVGElement} */ (element.parentNode); } return null; }; diff --git a/core/zoom_controls.js b/core/zoom_controls.js index 0cd53628c..3f741875d 100644 --- a/core/zoom_controls.js +++ b/core/zoom_controls.js @@ -31,10 +31,14 @@ goog.require('Blockly.utils.dom'); /** * Class for a zoom controls. - * @param {!Blockly.Workspace} workspace The workspace to sit in. + * @param {!Blockly.WorkspaceSVG} workspace The workspace to sit in. * @constructor */ Blockly.ZoomControls = function(workspace) { + /** + * @type {!Blockly.WorkspaceSvg} + * @private + */ this.workspace_ = workspace; }; @@ -128,9 +132,7 @@ Blockly.ZoomControls.prototype.init = function(verticalSpacing) { Blockly.ZoomControls.prototype.dispose = function() { if (this.svgGroup_) { Blockly.utils.dom.removeNode(this.svgGroup_); - this.svgGroup_ = null; } - this.workspace_ = null; }; /**