diff --git a/core/modules/widgets/edit-text.js b/core/modules/widgets/edit-text.js index 59f5ab33f..ef6b04501 100644 --- a/core/modules/widgets/edit-text.js +++ b/core/modules/widgets/edit-text.js @@ -71,6 +71,13 @@ EditTextWidget.prototype.render = function(parent,nextSibling) { } // Fix height this.fixHeight(); + + // Focus field + if(this.editFocus === "true") { + domNode.focus(); + domNode.select(); + } + }; /* @@ -140,6 +147,8 @@ EditTextWidget.prototype.execute = function() { this.editAutoHeight = this.getAttribute("autoHeight","yes") === "yes"; this.editMinHeight = this.getAttribute("minHeight",DEFAULT_MIN_TEXT_AREA_HEIGHT); this.editFocusPopup = this.getAttribute("focusPopup"); + this.editFocus = this.getAttribute("focus"); + // Get the editor element tag and type var tag,type; if(this.editField === "text") { diff --git a/core/ui/EditTemplate/title.tid b/core/ui/EditTemplate/title.tid index ed2732805..829f91afe 100644 --- a/core/ui/EditTemplate/title.tid +++ b/core/ui/EditTemplate/title.tid @@ -1,4 +1,4 @@ title: $:/core/ui/EditTemplate/title tags: $:/tags/EditTemplate -<$edit-text field="draft.title" class="tc-titlebar tc-edit-texteditor"/> +<$edit-text field="draft.title" class="tc-titlebar tc-edit-texteditor" focus="true"/> \ No newline at end of file