mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-08-06 13:48:58 +02:00
Merge 47df8ce1b4
into 043db37dfb
This commit is contained in:
commit
52850e5182
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -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
|
||||||
|
@ -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();
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user