From b83ca04e7247d743ea0c4412b3c2d703e64d3287 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 --- core/client/app/components/gh-ed-editor.js | 2 +- core/client/app/mixins/editor-base-controller.js | 1 - core/client/app/templates/editor/edit.hbs | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/client/app/components/gh-ed-editor.js b/core/client/app/components/gh-ed-editor.js index eb452d1dd1..48ac69609c 100644 --- a/core/client/app/components/gh-ed-editor.js +++ b/core/client/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/core/client/app/mixins/editor-base-controller.js b/core/client/app/mixins/editor-base-controller.js index fe470f5bd6..ff3ab676fb 100644 --- a/core/client/app/mixins/editor-base-controller.js +++ b/core/client/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/core/client/app/templates/editor/edit.hbs b/core/client/app/templates/editor/edit.hbs index 69ca8bbff8..fcc4d8e79c 100644 --- a/core/client/app/templates/editor/edit.hbs +++ b/core/client/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"}}