From eb4c555e4934c0757a20b027ddac3e6661d21078 Mon Sep 17 00:00:00 2001 From: Austin Burdine Date: Wed, 3 Jun 2015 12:01:32 -0600 Subject: [PATCH] fixes autofocus on post edit closes #5383 - sets the default focus of the editor component to false - removes the check for model.isNew in editor controller --- ghost/admin/app/components/gh-ed-editor.js | 2 +- ghost/admin/app/mixins/editor-base-controller.js | 1 - ghost/admin/app/templates/editor/edit.hbs | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ghost/admin/app/components/gh-ed-editor.js b/ghost/admin/app/components/gh-ed-editor.js index eb452d1dd1..48ac69609c 100644 --- a/ghost/admin/app/components/gh-ed-editor.js +++ b/ghost/admin/app/components/gh-ed-editor.js @@ -6,7 +6,7 @@ import EditorScroll from 'ghost/mixins/ed-editor-scroll'; var Editor; Editor = Ember.TextArea.extend(EditorAPI, EditorShortcuts, EditorScroll, { - focus: true, + focus: false, /** * Tell the controller about focusIn events, will trigger an autosave on a new document diff --git a/ghost/admin/app/mixins/editor-base-controller.js b/ghost/admin/app/mixins/editor-base-controller.js index fe470f5bd6..ff3ab676fb 100644 --- a/ghost/admin/app/mixins/editor-base-controller.js +++ b/ghost/admin/app/mixins/editor-base-controller.js @@ -236,7 +236,6 @@ export default Ember.Mixin.create({ }, shouldFocusTitle: Ember.computed.alias('model.isNew'), - shouldFocusEditor: Ember.computed.not('model.isNew'), actions: { save: function (options) { diff --git a/ghost/admin/app/templates/editor/edit.hbs b/ghost/admin/app/templates/editor/edit.hbs index 69ca8bbff8..fcc4d8e79c 100644 --- a/ghost/admin/app/templates/editor/edit.hbs +++ b/ghost/admin/app/templates/editor/edit.hbs @@ -13,8 +13,7 @@
{{gh-ed-editor classNames="markdown-editor js-markdown-editor" tabindex="1" spellcheck="true" value=model.scratch - scrollInfo=view.editorScrollInfo focus=shouldFocusEditor focusCursorAtEnd=model.isDirty - setEditor="setEditor" openModal="openModal" onFocusIn="autoSaveNew"}} + scrollInfo=view.editorScrollInfo setEditor="setEditor" openModal="openModal" onFocusIn="autoSaveNew"}}