FIX: Searching for spaces wouldn't stop spinning
This commit is contained in:
parent
abffcd9f94
commit
36683ff1e3
|
@ -11,8 +11,8 @@ Discourse.SearchController = Em.ArrayController.extend(Discourse.Presence, {
|
||||||
// If we need to perform another search
|
// If we need to perform another search
|
||||||
newSearchNeeded: function() {
|
newSearchNeeded: function() {
|
||||||
this.set('noResults', false);
|
this.set('noResults', false);
|
||||||
var term = this.get('term');
|
var term = (this.get('term') || '').trim();
|
||||||
if (term && term.length >= Discourse.SiteSettings.min_search_term_length) {
|
if (term.length >= Discourse.SiteSettings.min_search_term_length) {
|
||||||
this.set('loading', true);
|
this.set('loading', true);
|
||||||
this.searchTerm(term, this.get('typeFilter'));
|
this.searchTerm(term, this.get('typeFilter'));
|
||||||
} else {
|
} else {
|
||||||
|
@ -57,6 +57,8 @@ Discourse.SearchController = Em.ArrayController.extend(Discourse.Presence, {
|
||||||
self.set('urls', urls);
|
self.set('urls', urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.set('loading', false);
|
||||||
|
}).catch(function() {
|
||||||
self.set('loading', false);
|
self.set('loading', false);
|
||||||
});
|
});
|
||||||
}, 300),
|
}, 300),
|
||||||
|
|
Loading…
Reference in New Issue