summaryrefslogtreecommitdiffstats
path: root/src/modules/WYSiWYG.ts
diff options
context:
space:
mode:
authorMaksymilian Jopek <maks@jopek.eu>2021-10-31 14:31:29 +0100
committerMaksymilian Jopek <maks@jopek.eu>2021-10-31 14:31:29 +0100
commit27075885e95bd0efc062920685e04287feb4b556 (patch)
tree0c51ab493589bd0ebd7b733ada697ed777aa08d1 /src/modules/WYSiWYG.ts
parentdbb66972ebd987f60e10939bfb4493f87bbc73c3 (diff)
downloadisiqandisi-27075885e95bd0efc062920685e04287feb4b556.tar.gz
isiqandisi-27075885e95bd0efc062920685e04287feb4b556.tar.zst
isiqandisi-27075885e95bd0efc062920685e04287feb4b556.zip
Almost the end
Diffstat (limited to 'src/modules/WYSiWYG.ts')
-rw-r--r--src/modules/WYSiWYG.ts8
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) {