mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -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 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 a new issue