mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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 editingTopic}}
|
||||||
{{#if isPrivateMessage}}
|
{{#if isPrivateMessage}}
|
||||||
<span class="private-message-glyph">{{fa-icon envelope}}</span>
|
<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}}
|
{{else}}
|
||||||
{{text-field id='edit-title' value=newTitle maxLength=maxTitleLength}}
|
{{autofocus-text-field id='edit-title' value=newTitle maxLength=maxTitleLength}}
|
||||||
</br>
|
</br>
|
||||||
{{category-chooser valueAttribute="id" value=newCategoryId source=category_id}}
|
{{category-chooser valueAttribute="id" value=newCategoryId source=category_id}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Loading…
Reference in New Issue
Block a user