mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 11:13:38 +08:00
DEV: Half-revert search-menu flicker fix (#24975)
This commit is contained in:
parent
94884614d6
commit
6d5dd92ea1
|
@ -2,76 +2,78 @@
|
|||
<SearchMenu::BrowserSearchTip />
|
||||
{{else}}
|
||||
<div class="results">
|
||||
<PluginOutlet
|
||||
@name="search-menu-results-top"
|
||||
@outletArgs={{hash
|
||||
closeSearchMenu=@closeSearchMenu
|
||||
searchTerm=this.search.activeGlobalSearchTerm
|
||||
inTopicContext=this.search.inTopicContext
|
||||
searchTopics=@searchTopics
|
||||
}}
|
||||
/>
|
||||
{{#if @suggestionKeyword}}
|
||||
<SearchMenu::Results::Assistant
|
||||
@suggestionKeyword={{@suggestionKeyword}}
|
||||
@results={{@suggestionResults}}
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
@searchTermChanged={{@searchTermChanged}}
|
||||
{{#unless @loading}}
|
||||
<PluginOutlet
|
||||
@name="search-menu-results-top"
|
||||
@outletArgs={{hash
|
||||
closeSearchMenu=@closeSearchMenu
|
||||
searchTerm=this.search.activeGlobalSearchTerm
|
||||
inTopicContext=this.search.inTopicContext
|
||||
searchTopics=@searchTopics
|
||||
}}
|
||||
/>
|
||||
{{else if this.termTooShort}}
|
||||
<div class="no-results">{{i18n "search.too_short"}}</div>
|
||||
{{else if this.noTopicResults}}
|
||||
<div class="no-results">{{i18n "search.no_results"}}</div>
|
||||
{{else if this.renderInitialOptions}}
|
||||
<SearchMenu::Results::InitialOptions
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
@searchTermChanged={{@searchTermChanged}}
|
||||
/>
|
||||
{{else}}
|
||||
{{#if (and (not @searchTopics) (not @inPMInboxContext))}}
|
||||
{{! render the first couple suggestions before a search has been performed}}
|
||||
{{#if @suggestionKeyword}}
|
||||
<SearchMenu::Results::Assistant
|
||||
@suggestionKeyword={{@suggestionKeyword}}
|
||||
@results={{@suggestionResults}}
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
@searchTermChanged={{@searchTermChanged}}
|
||||
/>
|
||||
{{else if this.termTooShort}}
|
||||
<div class="no-results">{{i18n "search.too_short"}}</div>
|
||||
{{else if this.noTopicResults}}
|
||||
<div class="no-results">{{i18n "search.no_results"}}</div>
|
||||
{{else if this.renderInitialOptions}}
|
||||
<SearchMenu::Results::InitialOptions
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
@searchTermChanged={{@searchTermChanged}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if (and (not @searchTopics) (not @inPMInboxContext))}}
|
||||
{{! render the first couple suggestions before a search has been performed}}
|
||||
<SearchMenu::Results::InitialOptions
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
@searchTermChanged={{@searchTermChanged}}
|
||||
/>
|
||||
{{/if}}
|
||||
|
||||
{{#if (and @searchTopics this.resultTypesWithComponent)}}
|
||||
{{! render results after a search has been performed }}
|
||||
<SearchMenu::Results::Types
|
||||
@resultTypes={{this.resultTypesWithComponent}}
|
||||
@topicResultsOnly={{true}}
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
/>
|
||||
<SearchMenu::Results::MoreLink
|
||||
@updateTypeFilter={{@updateTypeFilter}}
|
||||
@triggerSearch={{@triggerSearch}}
|
||||
@resultTypes={{this.resultTypesWithComponent}}
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
@searchTermChanged={{@searchTermChanged}}
|
||||
/>
|
||||
{{else if
|
||||
(and
|
||||
(not @inPMInboxContext)
|
||||
(not @searchTopics)
|
||||
this.resultTypesWithComponent
|
||||
)
|
||||
}}
|
||||
<SearchMenu::Results::Types
|
||||
@resultTypes={{this.resultTypesWithComponent}}
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
@searchTermChanged={{@searchTermChanged}}
|
||||
/>
|
||||
{{#if (and @searchTopics this.resultTypesWithComponent)}}
|
||||
{{! render results after a search has been performed }}
|
||||
<SearchMenu::Results::Types
|
||||
@resultTypes={{this.resultTypesWithComponent}}
|
||||
@topicResultsOnly={{true}}
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
/>
|
||||
<SearchMenu::Results::MoreLink
|
||||
@updateTypeFilter={{@updateTypeFilter}}
|
||||
@triggerSearch={{@triggerSearch}}
|
||||
@resultTypes={{this.resultTypesWithComponent}}
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
@searchTermChanged={{@searchTermChanged}}
|
||||
/>
|
||||
{{else if
|
||||
(and
|
||||
(not @inPMInboxContext)
|
||||
(not @searchTopics)
|
||||
this.resultTypesWithComponent
|
||||
)
|
||||
}}
|
||||
<SearchMenu::Results::Types
|
||||
@resultTypes={{this.resultTypesWithComponent}}
|
||||
@closeSearchMenu={{@closeSearchMenu}}
|
||||
@searchTermChanged={{@searchTermChanged}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
<PluginOutlet
|
||||
@name="search-menu-results-bottom"
|
||||
@outletArgs={{hash
|
||||
inTopicContext=this.search.inTopicContext
|
||||
searchTermChanged=@searchTermChanged
|
||||
searchTopics=@searchTopics
|
||||
closeSearchMenu=@closeSearchMenu
|
||||
}}
|
||||
/>
|
||||
<PluginOutlet
|
||||
@name="search-menu-results-bottom"
|
||||
@outletArgs={{hash
|
||||
inTopicContext=this.search.inTopicContext
|
||||
searchTermChanged=@searchTermChanged
|
||||
searchTopics=@searchTopics
|
||||
closeSearchMenu=@closeSearchMenu
|
||||
}}
|
||||
/>
|
||||
{{/unless}}
|
||||
</div>
|
||||
{{/if}}
|
Loading…
Reference in New Issue
Block a user