From 8eba82b906d97102a5488830b34191d83161840f Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 17 Oct 2019 16:52:52 -0500 Subject: [PATCH] Fix 4 misc warnings (#3283) --- core/dropdowndiv.js | 4 ++-- core/field.js | 4 ++-- core/field_multilineinput.js | 2 +- core/field_textinput.js | 2 +- core/tooltip.js | 2 ++ core/utils/style.js | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/dropdowndiv.js b/core/dropdowndiv.js index 68412dbee..5931c937c 100644 --- a/core/dropdowndiv.js +++ b/core/dropdowndiv.js @@ -276,7 +276,7 @@ Blockly.DropDownDiv.getScaledBboxOfBlock_ = function(block) { * @private */ Blockly.DropDownDiv.getScaledBboxOfField_ = function(field) { - var bBox = field.getScaledBBox_(); + var bBox = field.getScaledBBox(); return new Blockly.utils.Rect( bBox.top, bBox.bottom, bBox.left, bBox.right); }; @@ -700,7 +700,7 @@ Blockly.DropDownDiv.repositionForWindowResize = function() { // event and we want the dropdown div to stick around so users can type into // it. if (Blockly.DropDownDiv.owner_) { - var field = Blockly.DropDownDiv.owner_; + var field = /** @type {!Blockly.Field} */ (Blockly.DropDownDiv.owner_); var block = Blockly.DropDownDiv.owner_.getSourceBlock(); var bBox = Blockly.DropDownDiv.positionToField_ ? Blockly.DropDownDiv.getScaledBboxOfField_(field) : diff --git a/core/field.js b/core/field.js index 5e5216533..e089adc3b 100644 --- a/core/field.js +++ b/core/field.js @@ -680,9 +680,9 @@ Blockly.Field.prototype.getSize = function() { * scaling. * @return {!Object} An object with top, bottom, left, and right in pixels * relative to the top left corner of the page (window coordinates). - * @protected + * @package */ -Blockly.Field.prototype.getScaledBBox_ = function() { +Blockly.Field.prototype.getScaledBBox = function() { var bBox = this.borderRect_.getBBox(); var scaledHeight = bBox.height * this.sourceBlock_.workspace.scale; var scaledWidth = bBox.width * this.sourceBlock_.workspace.scale; diff --git a/core/field_multilineinput.js b/core/field_multilineinput.js index 41e16b0fd..26ba0a34c 100644 --- a/core/field_multilineinput.js +++ b/core/field_multilineinput.js @@ -220,7 +220,7 @@ Blockly.FieldMultilineInput.prototype.updateSize_ = function() { */ Blockly.FieldMultilineInput.prototype.resizeEditor_ = function() { var div = Blockly.WidgetDiv.DIV; - var bBox = this.getScaledBBox_(); + var bBox = this.getScaledBBox(); div.style.width = bBox.right - bBox.left + 'px'; div.style.height = bBox.bottom - bBox.top + 'px'; diff --git a/core/field_textinput.js b/core/field_textinput.js index 2fb87c2e2..004348309 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -436,7 +436,7 @@ Blockly.FieldTextInput.prototype.setEditorValue_ = function(newValue) { */ Blockly.FieldTextInput.prototype.resizeEditor_ = function() { var div = Blockly.WidgetDiv.DIV; - var bBox = this.getScaledBBox_(); + var bBox = this.getScaledBBox(); div.style.width = bBox.right - bBox.left + 'px'; div.style.height = bBox.bottom - bBox.top + 'px'; diff --git a/core/tooltip.js b/core/tooltip.js index 747bd3f18..28ddefeb8 100644 --- a/core/tooltip.js +++ b/core/tooltip.js @@ -78,6 +78,7 @@ Blockly.Tooltip.lastY_ = 0; /** * Current element being pointed at. + * @type {Element} * @private */ Blockly.Tooltip.element_ = null; @@ -85,6 +86,7 @@ Blockly.Tooltip.element_ = null; /** * Once a tooltip has opened for an element, that element is 'poisoned' and * cannot respawn a tooltip until the pointer moves over a different element. + * @type {Element} * @private */ Blockly.Tooltip.poisonedElement_ = null; diff --git a/core/utils/style.js b/core/utils/style.js index 8f9ecddbb..3e01fe053 100644 --- a/core/utils/style.js +++ b/core/utils/style.js @@ -67,7 +67,7 @@ Blockly.utils.style.getSize = function(element) { /** * Gets the height and width of an element when the display is not none. * @param {!Element} element Element to get size of. - * @return {!goog.math.Size} Object with width/height properties. + * @return {!Blockly.utils.Size} Object with width/height properties. * @private */ Blockly.utils.style.getSizeWithDisplay_ = function(element) {