braces added for if condition

This commit is contained in:
Vinoth Kannan 2016-08-26 22:38:34 +05:30 committed by GitHub
parent fc95764f60
commit f373e3ac8d

View file

@ -97,14 +97,15 @@ export default createWidget('search-menu', {
const results = [this.attach('search-term', { value: searchData.term, contextEnabled }),
this.attach('search-context', { contextEnabled })];
if (searchData.term)
if (searchData.loading) {
results.push(h('div.searching', h('div.spinner')));
} else {
results.push(this.attach('search-menu-results', { term: searchData.term,
noResults: searchData.noResults,
results: searchData.results,
invalidTerm: searchData.invalidTerm }));
if (searchData.term) {
if (searchData.loading) {
results.push(h('div.searching', h('div.spinner')));
} else {
results.push(this.attach('search-menu-results', { term: searchData.term,
noResults: searchData.noResults,
results: searchData.results,
invalidTerm: searchData.invalidTerm }));
}
}
return results;