Skip to content

Commit 7cfba4a

Browse files
committed
1 parent cae0484 commit 7cfba4a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default class PluginSample extends Plugin {
2323

2424
private customTab: () => IModel;
2525
private isMobile: boolean;
26+
private blockIconEventBindThis = this.blockIconEvent.bind(this)
2627

2728
onload() {
2829
this.data[STORAGE_NAME] = {readonlyText: "Readonly"};
@@ -361,13 +362,13 @@ export default class PluginSample extends Plugin {
361362
icon: "iconSelect",
362363
label: "On click-blockicon",
363364
click: () => {
364-
this.eventBus.on("click-blockicon", this.blockIconEvent);
365+
this.eventBus.on("click-blockicon", this.blockIconEventBindThis);
365366
}
366367
}, {
367368
icon: "iconClose",
368369
label: "Off click-blockicon",
369370
click: () => {
370-
this.eventBus.off("click-blockicon", this.blockIconEvent);
371+
this.eventBus.off("click-blockicon", this.blockIconEventBindThis);
371372
}
372373
}, {
373374
icon: "iconSelect",

0 commit comments

Comments
 (0)