mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Do not focus post title when editing.
This commit is contained in:
parent
918a911d3f
commit
1d360b3d18
3 changed files with 10 additions and 2 deletions
|
@ -1,6 +1,10 @@
|
|||
var TrimFocusInput = Ember.TextField.extend({
|
||||
focus: true,
|
||||
|
||||
setFocus: function () {
|
||||
this.$().val(this.$().val()).focus();
|
||||
if (this.focus) {
|
||||
this.$().val(this.$().val()).focus();
|
||||
}
|
||||
}.on('didInsertElement'),
|
||||
|
||||
focusOut: function () {
|
||||
|
|
|
@ -184,6 +184,10 @@ var EditorControllerMixin = Ember.Mixin.create(MarkerManager, {
|
|||
this.notifications.showError(message, { delayed: delay });
|
||||
},
|
||||
|
||||
shouldFocusTitle: Ember.computed('model', function () {
|
||||
return !!this.get('model.isNew');
|
||||
}),
|
||||
|
||||
actions: {
|
||||
save: function () {
|
||||
var status = this.get('willPublish') ? 'published' : 'draft',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<header>
|
||||
<section class="box entry-title">
|
||||
{{gh-trim-focus-input type="text" id="entry-title" placeholder="Your Post Title" value=titleScratch tabindex="1"}}
|
||||
{{gh-trim-focus-input type="text" id="entry-title" placeholder="Your Post Title" value=titleScratch tabindex="1" focus=shouldFocusTitle}}
|
||||
</section>
|
||||
</header>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue