diff --git a/ghost/admin/components/gh-focus-input.js b/ghost/admin/components/gh-focus-input.js new file mode 100644 index 0000000000..2a3528705e --- /dev/null +++ b/ghost/admin/components/gh-focus-input.js @@ -0,0 +1,7 @@ +var FocusInput = Ember.TextField.extend({ + becomeFocused: function () { + this.$().val(this.$().val()).focus(); + }.on('didInsertElement') +}); + +export default FocusInput; diff --git a/ghost/admin/templates/editor/edit.hbs b/ghost/admin/templates/editor/edit.hbs index 40927e39c9..a06d788053 100644 --- a/ghost/admin/templates/editor/edit.hbs +++ b/ghost/admin/templates/editor/edit.hbs @@ -1,6 +1,6 @@
- {{input type="text" id="entry-title" placeholder="Your Post Title" value=title tabindex="1"}} + {{gh-focus-input type="text" id="entry-title" placeholder="Your Post Title" value=title tabindex="1"}}