From f7cfffab9770ecc02b4970e6d9c9a5535e57ede6 Mon Sep 17 00:00:00 2001 From: Lucas Cumsille M Date: Thu, 12 Dec 2024 08:11:14 +0000 Subject: [PATCH] Added confirmation when deleting alerts --- www/docs/js/main.js | 14 ++++++++++++++ .../easyparliament/templates/html/alert/_list.php | 2 +- .../easyparliament/templates/html/alert/index.php | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/www/docs/js/main.js b/www/docs/js/main.js index 9f319d38f9..729bbbc150 100644 --- a/www/docs/js/main.js +++ b/www/docs/js/main.js @@ -486,6 +486,20 @@ document.addEventListener('DOMContentLoaded', function() { createAccordion('.accordion-button', '.accordion-content'); }); +// Comfirm deletion of alerts +function confirmDelete() { + var triggers = document.querySelectorAll('.js-confirm-delete'); + + triggers.forEach(function(trigger) { + trigger.addEventListener('click', function(event) { + var message = "Are you sure you want to delete all alerts?"; + if (!confirm(message)) { + event.preventDefault(); + } + }); + }); +} +confirmDelete(); $(function() { diff --git a/www/includes/easyparliament/templates/html/alert/_list.php b/www/includes/easyparliament/templates/html/alert/_list.php index 41d20873d0..4c685f6adf 100644 --- a/www/includes/easyparliament/templates/html/alert/_list.php +++ b/www/includes/easyparliament/templates/html/alert/_list.php @@ -10,6 +10,6 @@
- +
diff --git a/www/includes/easyparliament/templates/html/alert/index.php b/www/includes/easyparliament/templates/html/alert/index.php index 2bb2119685..addb7dcfb3 100644 --- a/www/includes/easyparliament/templates/html/alert/index.php +++ b/www/includes/easyparliament/templates/html/alert/index.php @@ -316,7 +316,7 @@
- +