From 3db007601958529aa87aaaadc2a82f5e6fccba45 Mon Sep 17 00:00:00 2001 From: tofulm Date: Thu, 14 May 2020 23:47:59 +0200 Subject: [PATCH] on ajoute un petit test pour moins d'erreurs --- js/gamutable.es6.js | 8 +++++--- js/gamutable.js | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/js/gamutable.es6.js b/js/gamutable.es6.js index 5eeffbe..bf2e443 100644 --- a/js/gamutable.es6.js +++ b/js/gamutable.es6.js @@ -5,7 +5,7 @@ jQuery(function () { e.preventDefault(); e.stopPropagation(); let confirmation = $(this).data('confirm'); - if (confirmation) { + if (confirmation !== undefined) { if (!confirm(confirmation)) { return; } @@ -28,7 +28,8 @@ jQuery(function () { // lancement d'une modalbox $('#app').on('click', '.modalbox', function (e) { e.preventDefault(); - if (confirmation) { + let confirmation = $(this).data('confirm'); + if (confirmation !== undefined) { if (!confirm(confirmation)) { return; } @@ -41,7 +42,8 @@ jQuery(function () { // lancement d'une médiabox $('#app').on('click', '.mediabox', function (e) { e.preventDefault(); - if (confirmation) { + let confirmation = $(this).data('confirm'); + if (confirmation !== undefined) { if (!confirm(confirmation)) { return; } diff --git a/js/gamutable.js b/js/gamutable.js index 60e8256..98c1e34 100644 --- a/js/gamutable.js +++ b/js/gamutable.js @@ -24,7 +24,7 @@ jQuery(function () { e.stopPropagation(); var confirmation = $(this).data('confirm'); - if (confirmation) { + if (confirmation !== undefined) { if (!confirm(confirmation)) { return; } @@ -47,8 +47,9 @@ jQuery(function () { $('#app').on('click', '.modalbox', function (e) { e.preventDefault(); + var confirmation = $(this).data('confirm'); - if (confirmation) { + if (confirmation !== undefined) { if (!confirm(confirmation)) { return; } @@ -61,8 +62,9 @@ jQuery(function () { $('#app').on('click', '.mediabox', function (e) { e.preventDefault(); + var confirmation = $(this).data('confirm'); - if (confirmation) { + if (confirmation !== undefined) { if (!confirm(confirmation)) { return; }