Skip to content

Commit

Permalink
Fix fluid search
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 committed Feb 2, 2022
1 parent 2dacaab commit 817c07d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions templates/components/search/display_data.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# ---------------------------------------------------------------------
#}

{% set is_ajax = data['searchform_id'] is defined %}
{% set is_ajax = data['searchform_id'] is defined and data['searchform_id'] is not null %}
{% if not is_ajax %}
<div class="ajax-container search-display-data">
{% endif %}
Expand Down Expand Up @@ -74,8 +74,15 @@
{% if not is_ajax %}
</div>
<script>
$(document).on('ready', () => {
new GLPI.Search.ResultsView("massform{{ normalized_itemtype }}", GLPI.Search.Table);
});
if (typeof initFluidSearch !== "function") {
window.initFluidSearch = () => {
new GLPI.Search.ResultsView("massform{{ normalized_itemtype }}", GLPI.Search.Table);
};
}
if (document.readyState === 'complete') {
initFluidSearch();
} else {
$(document).on('ready', initFluidSearch);
}
</script>
{% endif %}

0 comments on commit 817c07d

Please sign in to comment.