mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 02:23:45 +08: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
|
@ -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 New Issue
Block a user