This commit is contained in:
Ludy 2025-07-28 11:09:25 +01:00 committed by GitHub
commit 52850e5182
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 51 additions and 44 deletions

View File

@ -247,7 +247,7 @@ jobs:
test-build-docker-images: test-build-docker-images:
if: github.event_name == 'pull_request' && needs.files-changed.outputs.project == 'true' if: github.event_name == 'pull_request' && needs.files-changed.outputs.project == 'true'
needs: [files-changed, build, check-generateOpenApiDocs, check-licence] needs: [files-changed, build]
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -82,18 +82,25 @@ document.querySelector("#navbarSearchInput").addEventListener("input", function
resultsBox.style.width = window.navItemMaxWidth + "px"; resultsBox.style.width = window.navItemMaxWidth + "px";
}); });
document.addEventListener('DOMContentLoaded', function () {
const searchDropdown = document.getElementById('searchDropdown');
const searchInput = document.getElementById('navbarSearchInput');
const searchDropdown = document.getElementById('searchDropdown'); // Check if elements are missing and skip initialization if necessary
const searchInput = document.getElementById('navbarSearchInput'); if (!searchDropdown || !searchInput) {
console.warn('Search dropdown or input not found. Skipping initialization.');
// Check if elements exist before proceeding return;
if (searchDropdown && searchInput) { }
const dropdownMenu = searchDropdown.querySelector('.dropdown-menu'); const dropdownMenu = searchDropdown.querySelector('.dropdown-menu');
if (!dropdownMenu) {
console.warn('Dropdown menu not found within the search dropdown. Skipping initialization.');
return;
}
// Create a single dropdown instance // Create a single dropdown instance
const dropdownInstance = new bootstrap.Dropdown(searchDropdown); const dropdownInstance = new bootstrap.Dropdown(searchDropdown);
// Handle click for mobile // Handle click for mobile
searchDropdown.addEventListener('click', function (e) { searchDropdown.addEventListener('click', function (e) {
e.preventDefault(); e.preventDefault();
const isOpen = dropdownMenu.classList.contains('show'); const isOpen = dropdownMenu.classList.contains('show');
@ -122,7 +129,7 @@ if (searchDropdown && searchInput) {
}); });
// Hide dropdown if it's open and user clicks outside // Hide dropdown if it's open and user clicks outside
document.addEventListener('click', function(e) { document.addEventListener('click', function (e) {
if (!searchDropdown.contains(e.target) && dropdownMenu.classList.contains('show')) { if (!searchDropdown.contains(e.target) && dropdownMenu.classList.contains('show')) {
dropdownInstance.hide(); dropdownInstance.hide();
} }
@ -133,4 +140,4 @@ if (searchDropdown && searchInput) {
e.stopPropagation(); e.stopPropagation();
}); });
} });