fix: Fix header search bar

This commit is contained in:
Vincent BRIDIER 2025-05-09 12:51:27 +02:00
parent 27c287b918
commit 610c7fbc00
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
3 changed files with 5 additions and 6 deletions

View file

@ -39,7 +39,6 @@ class SecureHeaders
View::share('nonce', $nonce = Vite::useCspNonce());
// * For VueJS dev tool to execute
$jsDev = config('app.debug') ? "'unsafe-eval' 'unsafe-inline'" : "'nonce-{$nonce}' 'strict-dynamic'";
$scheme = config('app.env') === 'local' ? 'http' : 'https';
$reportUri = Route::has('cspReportUri') ?
\sprintf(' report-uri %s ;', \parse_url(route('cspReportUri'), \PHP_URL_PATH)) : '';
$this->removeUnwantedHeaders($this->unwantedHeaderList);
@ -100,7 +99,6 @@ class SecureHeaders
'https: blob:',
'https://www.googletagmanager.com',
'https://cdnjs.cloudflare.com',
"$scheme://www.google-analytics.com",
// * VITE DEV
config('app.debug') ? "https://{$host}:4443" : '',
]) . ';'

View file

@ -49,13 +49,14 @@ window.addEventListener("DOMContentLoaded", () => {
// Affichage de la zone de texte de recherche
const displaySearchBtn = document.querySelector(
"#open-search-button"
".open-search-button"
) as HTMLButtonElement | null;
const closeSearchBtn = document.querySelector(
"#close-search-button"
".close-search-button"
) as HTMLButtonElement | null;
if (displaySearchBtn) {
displaySearchBtn.addEventListener("click", (e: MouseEvent) => {
e.preventDefault();
const searchInput = document.getElementById(

View file

@ -7,9 +7,9 @@
</button>
<form id="searchform" role="search" method="get" action="{{ route('fo.search') }}">
<div class="search-butn position-relative d-none d-md-block ms-4" role="button">
<x-uwil-common::markup.img id="open-search-button" alt="{{ __('Bouton de recherche') }}"
<x-uwil-common::markup.img class="open-search-button" alt="{{ __('Bouton de recherche') }}"
url="{{ Vite::asset('resources/assets/images/header/icon-recherche.svg') }}" />
<x-uwil-common::markup.img id="close-search-button" alt="{{ __('Bouton de recherche') }}"
<x-uwil-common::markup.img class="close-search-button" alt="{{ __('Bouton de recherche') }}"
url="{{ Vite::asset('resources/assets/images/header/icon-close.svg') }}" />
<input class="form-control black-square position-absolute top-50 translate-middle-y start-0 ms-4 p-2"
id="search-input" name="search" type="search" placeholder="Rechercher" required>