diff options
Diffstat (limited to 'src/modules/WYSiWYG.ts')
| -rw-r--r-- | src/modules/WYSiWYG.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/WYSiWYG.ts b/src/modules/WYSiWYG.ts index 1161cde..39b627e 100644 --- a/src/modules/WYSiWYG.ts +++ b/src/modules/WYSiWYG.ts @@ -8,6 +8,7 @@ export default class WYSiWYG { #id = 'tinymce' #bSave: HTMLButtonElement #bCancel: HTMLButtonElement + #whoClicked?: Chit; constructor() { tinymce.init({ @@ -29,7 +30,8 @@ export default class WYSiWYG { this.#bCancel.id = "cancel" tf.append(this.#bSave, this.#bCancel) - this.#bSave.onclick = () => this.setContent(this.content + "asd"); + // this.#bSave.onclick = () => this.setContent(this.content + "asd"); + this.#bSave.onclick = () => this.hide(); this.#bCancel.onclick = () => this.hide(); this.hide() } @@ -38,11 +40,13 @@ export default class WYSiWYG { return tinymce.get(this.#id); } show(c: Chit) { - console.log(c.txt) this.#tmce.show(); this.setContent(c.txt) + this.#whoClicked = c; } hide() { + if (this.#whoClicked != null) + this.#whoClicked.txt = this.content; this.#tmce.hide(); } setContent(c: string) { |
