fix: Silence Closure errors when modifying tooltips. (#6098)

This commit is contained in:
Aaron Dodson
2022-04-21 13:22:21 -07:00
committed by GitHub
parent eb0dbe1f15
commit 29b6b878dc
4 changed files with 4 additions and 4 deletions

View File

@@ -248,7 +248,7 @@ class BlockSvg extends Block {
svgMath.is3dSupported() && !!workspace.getBlockDragSurface();
const svgPath = this.pathObject.svgPath;
svgPath.tooltip = this;
(/** @type {?} */ (svgPath)).tooltip = this;
Tooltip.bindMouseEvents(svgPath);
// Expose this block's ID on its top-level SVG group.

View File

@@ -1097,7 +1097,7 @@ class Field {
}
const clickTarget = this.getClickTarget_();
if (clickTarget) {
clickTarget.tooltip = newTip;
(/** @type {?} */ (clickTarget)).tooltip = newTip;
} else {
// Field has not been initialized yet.
this.tooltip_ = newTip;

View File

@@ -1045,7 +1045,7 @@ class Flyout extends DeleteArea {
'width': blockHW.width,
},
null);
rect.tooltip = block;
(/** @type {?} */ (rect)).tooltip = block;
Tooltip.bindMouseEvents(rect);
// Add the rectangles under the blocks, so that the blocks' tooltips work.
this.workspace_.getCanvas().insertBefore(rect, block.getSvgRoot());

View File

@@ -363,7 +363,7 @@ const onMouseOut = function(_e) {
* @param {!Event} e Mouse event.
*/
const onMouseMove = function(e) {
if (!element || !element.tooltip) {
if (!element || !(/** @type {?} */ (element)).tooltip) {
// No tooltip here to show.
return;
} else if (blocked) {