diff --git a/core/modules/editor/engines/framed.js b/core/modules/editor/engines/framed.js index 34d11dec7..911cdf180 100644 --- a/core/modules/editor/engines/framed.js +++ b/core/modules/editor/engines/framed.js @@ -81,6 +81,9 @@ function FramedEngine(options) { if(this.widget.isDisabled === "yes") { this.domNode.setAttribute("disabled",true); } + if(this.widget.editDirection) { + this.domNode.setAttribute("dir",this.widget.editDirection); + } // Copy the styles from the dummy textarea this.copyStyles(); // Add event listeners diff --git a/core/modules/editor/engines/simple.js b/core/modules/editor/engines/simple.js index 809dc58ea..2fd408aec 100644 --- a/core/modules/editor/engines/simple.js +++ b/core/modules/editor/engines/simple.js @@ -58,6 +58,9 @@ function SimpleEngine(options) { if(this.widget.isDisabled === "yes") { this.domNode.setAttribute("disabled",true); } + if(this.widget.editDirection) { + this.domNode.setAttribute("dir",this.widget.editDirection); + } // Add an input event handler $tw.utils.addEventListeners(this.domNode,[ {name: "focus", handlerObject: this, handlerMethod: "handleFocusEvent"}, diff --git a/core/modules/editor/factory.js b/core/modules/editor/factory.js index 6157ec67f..4fb67d0b9 100644 --- a/core/modules/editor/factory.js +++ b/core/modules/editor/factory.js @@ -187,6 +187,7 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) { this.editInputActions = this.getAttribute("inputActions"); this.editRefreshTitle = this.getAttribute("refreshTitle"); this.editAutoComplete = this.getAttribute("autocomplete"); + this.editDirection = this.document.getElementsByTagName("html")[0].getAttribute("dir") || "ltr"; this.isDisabled = this.getAttribute("disabled","no"); this.isFileDropEnabled = this.getAttribute("fileDrop","no") === "yes"; // Get the default editor element tag and type