From a19bc2d0124caa361db7a47486c89fbb813b6416 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Mon, 8 Feb 2021 20:49:33 +0100 Subject: [PATCH] updateButtonState on clicking editor field --- ts/editor/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ts/editor/index.ts b/ts/editor/index.ts index 6eaad8ae3..81f42b5e6 100644 --- a/ts/editor/index.ts +++ b/ts/editor/index.ts @@ -138,6 +138,7 @@ export class EditingArea extends HTMLDivElement { this.addEventListener("paste", onPaste); this.addEventListener("copy", onCutOrCopy); this.addEventListener("oncut", onCutOrCopy); + this.addEventListener("click", updateButtonState); const baseStyleSheet = this.baseStyle.sheet as CSSStyleSheet; baseStyleSheet.insertRule("anki-editable {}", 0); @@ -152,6 +153,7 @@ export class EditingArea extends HTMLDivElement { this.removeEventListener("paste", onPaste); this.removeEventListener("copy", onCutOrCopy); this.removeEventListener("oncut", onCutOrCopy); + this.removeEventListener("click", updateButtonState); } initialize(color: string, content: string): void {