chg: [navbar:search_all] Fixed layout

pull/72/head
mokaddem 2021-09-17 19:06:56 +02:00
parent 24a8aa42c8
commit 468505b5c6
4 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,8 @@
<?php
$sections = [];
if (!empty($ajax)) {
$sections[] = '<div class="search-results-wrapper">';
}
foreach ($data as $tableName => $tableResult) {
if (empty($tableResult['amount'])) {
continue;
@ -57,6 +60,7 @@
$this->FontAwesome->getClass('search-plus'),
__('View all results')
);
$sections[] = '</div>';
} else {
echo sprintf('<h2 class="fw-light mb-4">%s <span class="font-monospace">%s</span></h2>', __('Global search results for:'), h($this->request->getParam('?')['search'] ?? ''));
}

View File

@ -7,6 +7,7 @@
<div class="dropdown">
<button type="button" class="dropdown-toggle d-none" id="dropdownMenuSearchAll" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-bs-reference="parent"></button>
<div class="global-search-result-container dropdown-menu dropdown-menu-end p-0 pt-2" aria-labelledby="dropdownMenuSearchAll">
<div class="search-results-wrapper text-center"><?= __('- No result -') ?></div>
</div>
</div>
</div>

View File

@ -881,7 +881,7 @@ class OverlayFactory {
}
static overlayWrapper = '<div aria-busy="true" class="position-relative"/>'
static overlayContainer = '<div class="position-absolute text-nowrap" style="inset: 0px; z-index: 10;"/>'
static overlayContainer = '<div class="position-absolute text-nowrap" style="inset: 0px; z-index: 1100;"/>'
static overlayBg = '<div class="position-absolute loading-overlay" style="inset: 0px;"/>'
static overlaySpinner = '<div class="position-absolute" style="top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%);"><span aria-hidden="true" class=""><!----></span></div></div>'
static overlayText = '<span class="ml-1 align-text-top"></span>'
@ -897,8 +897,8 @@ class OverlayFactory {
}
if (this.$node[0]) {
const boundingRect = this.$node[0].getBoundingClientRect()
this.$overlayWrapper.css('min-height', boundingRect.height)
this.$overlayWrapper.css('min-width', boundingRect.width)
this.$overlayWrapper.css('min-height', Math.max(boundingRect.height, 20))
this.$overlayWrapper.css('min-width', Math.max(boundingRect.width, 20))
}
this.$overlayContainer = $(OverlayFactory.overlayContainer)
this.$overlayBg = $(OverlayFactory.overlayBg)

View File

@ -135,7 +135,7 @@ function performGlobalSearch(evt) {
const searchParams = new URLSearchParams({search: value});
const url = endpoint + '?' + searchParams
const options = {
statusNode: $resultContainer
statusNode: $resultContainer.find('.search-results-wrapper')
}
bootstrap.Dropdown.getOrCreateInstance('#dropdownMenuSearchAll').show()