N°4076 - Revert regression in global search from 344cce9fd

Current query was not visible when reaching the results page
This commit is contained in:
Molkobain
2021-08-02 15:18:48 +02:00
parent 5c6c59941a
commit e28f704f3e
3 changed files with 3 additions and 2 deletions

View File

@@ -556,7 +556,7 @@ try
$sQueryLabel = $sFullText;
}
GlobalSearchHelper::AddQueryToHistory($sQuery, $sQueryIconUrl, $sQueryLabel);
$oP->AddBlockParam('global_search.query', $sQuery);
$oP->SetBlockParam('ibo-global-search.sQuery', $sQuery);
// Check the needle length
$iMinLenth = MetaModel::GetConfig()->Get('full_text_needle_min');

View File

@@ -1,7 +1,7 @@
<div id="{{ oUIBlock.GetId() }}"
{# Note: The "ibo-is-opened" class is put there and not through the JS widget to avoid visual glitches #}
{# Otherwise it would open only when the DOM is ready and the JS widget instantiated #}
class="ibo-global-search"
class="ibo-global-search {% if oUIBlock.HasQuery() %}ibo-is-opened{% endif %}"
data-role="ibo-global-search">
<form action="{{ oUIBlock.GetEndpoint() }}" method="get" class="ibo-global-search--head" data-role="ibo-global-search--head">
<a href="#" class="ibo-global-search--icon" data-role="ibo-global-search--icon"

View File

@@ -1,2 +1,3 @@
$('#{{ oUIBlock.GetId() }}').global_search({
init_opened: {{ oUIBlock.HasQuery()|var_export }}
});