diff --git a/core/modules/editor/engines/framed.js b/core/modules/editor/engines/framed.js index 3d7a90b6d..f46c86302 100644 --- a/core/modules/editor/engines/framed.js +++ b/core/modules/editor/engines/framed.js @@ -51,6 +51,13 @@ function FramedEngine(options) { tag = "input"; } this.domNode = this.iframeDoc.createElement(tag); + // Set the text + if(this.widget.editTag === "textarea") { + this.domNode.appendChild(this.iframeDoc.createTextNode(this.value)); + } else { + this.domNode.value = this.value; + } + // Set the attributes if(this.widget.editType) { this.domNode.setAttribute("type",this.widget.editType); } @@ -65,12 +72,6 @@ function FramedEngine(options) { } // Copy the styles from the dummy textarea this.copyStyles(); - // Set the text - if(this.widget.editTag === "textarea") { - this.domNode.appendChild(this.iframeDoc.createTextNode(this.value)); - } else { - this.domNode.value = this.value; - } // Add event listeners $tw.utils.addEventListeners(this.domNode,[ {name: "input",handlerObject: this,handlerMethod: "handleInputEvent"}, diff --git a/core/modules/editor/engines/simple.js b/core/modules/editor/engines/simple.js index 0b5891dcd..900d95276 100644 --- a/core/modules/editor/engines/simple.js +++ b/core/modules/editor/engines/simple.js @@ -27,6 +27,13 @@ function SimpleEngine(options) { tag = "input"; } this.domNode = this.widget.document.createElement(tag); + // Set the text + if(this.widget.editTag === "textarea") { + this.domNode.appendChild(this.widget.document.createTextNode(this.value)); + } else { + this.domNode.value = this.value; + } + // Set the attributes if(this.widget.editType) { this.domNode.setAttribute("type",this.widget.editType); } @@ -42,12 +49,6 @@ function SimpleEngine(options) { if(this.widget.editClass) { this.domNode.className = this.widget.editClass; } - // Set the text - if(this.widget.editTag === "textarea") { - this.domNode.appendChild(this.widget.document.createTextNode(this.value)); - } else { - this.domNode.value = this.value; - } // Add an input event handler $tw.utils.addEventListeners(this.domNode,[ {name: "focus", handlerObject: this, handlerMethod: "handleFocusEvent"},