mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Merge pull request #2878 from daemonsy/daemonsy_focus_topic_input
UX Improvement: Autofocus the topic field on edit
This commit is contained in:
commit
d439bd274e
2 changed files with 9 additions and 2 deletions
|
@ -0,0 +1,7 @@
|
|||
export default Ember.TextField.extend({
|
||||
becomeFocused: function() {
|
||||
var input = this.get("element");
|
||||
input.focus();
|
||||
input.selectionStart = input.selectionEnd = input.value.length;
|
||||
}.on('didInsertElement')
|
||||
});
|
|
@ -17,9 +17,9 @@
|
|||
{{#if editingTopic}}
|
||||
{{#if isPrivateMessage}}
|
||||
<span class="private-message-glyph">{{fa-icon envelope}}</span>
|
||||
{{text-field id='edit-title' value=newTitle maxLength=maxTitleLength}}
|
||||
{{autofocus-text-field id='edit-title' value=newTitle maxLength=maxTitleLength}}
|
||||
{{else}}
|
||||
{{text-field id='edit-title' value=newTitle maxLength=maxTitleLength}}
|
||||
{{autofocus-text-field id='edit-title' value=newTitle maxLength=maxTitleLength}}
|
||||
</br>
|
||||
{{category-chooser valueAttribute="id" value=newCategoryId source=category_id}}
|
||||
{{/if}}
|
||||
|
|
Loading…
Reference in a new issue