mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 13:53:44 +08:00
UX: Select search term when focus returns to search box.
This commit is contained in:
parent
b4974f5876
commit
2ae0ef0ad9
|
@ -134,7 +134,7 @@ export default Ember.Component.extend({
|
|||
},
|
||||
|
||||
showedSearch() {
|
||||
$('#search-term').focus();
|
||||
$('#search-term').focus().select();
|
||||
},
|
||||
|
||||
showSearchHelp() {
|
||||
|
|
|
@ -5,5 +5,9 @@ export default TextField.extend({
|
|||
@computed('searchService.searchContextEnabled')
|
||||
placeholder: function(searchContextEnabled) {
|
||||
return searchContextEnabled ? "" : I18n.t('search.title');
|
||||
},
|
||||
|
||||
focusIn: function() {
|
||||
Em.run.later(() => { this.$().select(); });
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="search row clearfix">
|
||||
{{input type="text" value=searchTerm class="input-xxlarge search no-blur" action="search"}}
|
||||
{{search-text-field value=searchTerm class="input-xxlarge search no-blur" action="search"}}
|
||||
{{d-button action="search" icon="search" class="btn-primary" disabled=isNotValidSearchTerm}}
|
||||
{{#if canBulkSelect}}
|
||||
{{#if model.posts}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user