Skip to content

Commit b2a5d2c

Browse files
committed
fix: use browserEvents.bind instead of direct binding
1 parent 9971b64 commit b2a5d2c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/renderer/cat/drawer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class Drawer extends ClassicDrawer {
8282
let ignoreBlink = false;
8383

8484
// TODO: Would it be better to use CSS for this?
85-
this.block_.pathObject.svgPath.addEventListener("mouseenter", () => {
85+
Blockly.browserEvents.bind(this.block_.pathObject.svgPath, "mouseenter", this, () => {
8686
if (ignoreBlink) return;
8787
ignoreBlink = true;
8888
setVisibility(this.parts_[FacePart.EYE_1_OPEN], false);
@@ -106,7 +106,7 @@ export class Drawer extends ClassicDrawer {
106106
let ignoreFlick1 = false;
107107
let ignoreFlick2 = false;
108108

109-
this.parts_[FacePart.EAR_1_INSIDE].addEventListener("mouseenter", () => {
109+
Blockly.browserEvents.bind(this.parts_[FacePart.EAR_1_INSIDE], "mouseenter", this, () => {
110110
if (ignoreFlick1) return;
111111
ignoreFlick1 = true;
112112
setVisibility(this.parts_[FacePart.EAR_1_INSIDE], false);
@@ -121,7 +121,7 @@ export class Drawer extends ClassicDrawer {
121121
ignoreFlick1 = false;
122122
}, 2 * flickDuration);
123123
});
124-
this.parts_[FacePart.EAR_2_INSIDE].addEventListener("mouseenter", () => {
124+
Blockly.browserEvents.bind(this.parts_[FacePart.EAR_2_INSIDE], "mouseenter", this, () => {
125125
if (ignoreFlick2) return;
126126
ignoreFlick2 = true;
127127
setVisibility(this.parts_[FacePart.EAR_2_INSIDE], false);

0 commit comments

Comments
 (0)