DEV: Half-revert search-menu flicker fix (#24975)

This commit is contained in:
Mark VanLandingham 2023-12-19 16:22:30 -06:00 committed by GitHub
parent 94884614d6
commit 6d5dd92ea1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 66 additions and 64 deletions

View File

@ -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}}