mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
fix: Silence Closure errors when modifying tooltips. (#6098)
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user