Merge pull request #3147 from rachel-fenichel/misc_cleanup

Misc cleanup
This commit is contained in:
Rachel Fenichel
2019-10-03 14:27:03 -07:00
committed by GitHub
3 changed files with 9 additions and 10 deletions

View File

@@ -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;
};
/**

View File

@@ -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;
};

View File

@@ -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;
};
/**