summaryrefslogtreecommitdiff
path: root/editor/editor.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor.ts')
-rw-r--r--editor/editor.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/editor/editor.ts b/editor/editor.ts
index dc11438..c7ce506 100644
--- a/editor/editor.ts
+++ b/editor/editor.ts
@@ -81,6 +81,15 @@ export class WuiEditor {
this.render(this.content);
}
+ setEditable(yes: boolean) {
+ this.isEditable = yes;
+ if (yes) {
+ this.elContent.setAttribute("contenteditable", "true");
+ } else {
+ this.elContent.setAttribute("contenteditable", "false");
+ }
+ }
+
private addNewLine() {
this.totalLine++;
const elLine = document.createElement("div");