From 036fa845f9cfceb04063619493a3d4e7caa66d95 Mon Sep 17 00:00:00 2001 From: vince Date: Tue, 28 Dec 2021 22:10:34 +0100 Subject: [PATCH] ferme automatiquement l'alert --- index.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/index.php b/index.php index 63ae10e..5f57e8c 100644 --- a/index.php +++ b/index.php @@ -336,13 +336,12 @@ if (!$isConfig and $hasSupplier) {
-
-
-
- -
+
+ +
@@ -356,7 +355,7 @@ if (!$isConfig and $hasSupplier) { / - +
@@ -592,7 +591,7 @@ if (!$isConfig and $hasSupplier) { }); }); - fields.forEach(function (field) { + fields.forEach(function (field) {e if ( (form.elements[field].value === '') && (window.localStorage.getItem('mon_panier_bio_' + field) !== null) @@ -601,6 +600,16 @@ if (!$isConfig and $hasSupplier) { } }); }); + document.querySelectorAll('.js-closealerts').forEach(function (element) { + element.addEventListener('input', function (event) { + if (event.target.value !== '') { + document.querySelectorAll('.alert').forEach(function (alertElement) { + var alert = bootstrap.Alert.getOrCreateInstance(alertElement) + alert.close(); + }); + } + }); + });