From 78dc82f7ac180250fe1a43c888b21872950fd8c7 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 3 Oct 2019 10:40:43 -0700 Subject: [PATCH] Misc cleanup: annotations, and flyoutButton disposal. --- core/flyout_button.js | 2 +- core/workspace_svg.js | 6 +++--- core/zoom_controls.js | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/flyout_button.js b/core/flyout_button.js index e1263d619..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; diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 87b5610d0..edffca58f 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_) { @@ -947,7 +947,7 @@ Blockly.WorkspaceSvg.prototype.getParentSvg = function() { while (element) { if (element.tagName == 'svg') { this.cachedParentSvg_ = element; - return element; + return /** @type {!SVGElement} */ (element); } element = element.parentNode; } 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; }; /**