]> git.ipfire.org Git - ipfire.org.git/commitdiff
wiki: editor: Initialise selection with some data
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 27 Aug 2019 13:53:31 +0000 (14:53 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 27 Aug 2019 14:22:54 +0000 (15:22 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/static/js/editor.js

index 148eb69a0e064efe087bad88be8c6ef57d629dd4..11be2666f6f33dbf6f85e123c6afcb24a96e9ce2 100644 (file)
@@ -5,6 +5,14 @@ class Editor {
         // Get the textarea
         this.textarea = this.parent.find("textarea");
 
+        // Initialise selection
+        this.selection = {
+            start  : 0,
+            end    : 0,
+            text   : "",
+            length : 0,
+        };
+
         // Make the textarea magic
         this.activateTextArea();