From a303bbeb19f283cbb4f843f7a07bd19a207faaaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dylan=20Delac=C3=B4te?= Date: Wed, 12 Jul 2023 11:26:20 +0200 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20Possibilit=C3=A9=20d'afficher=20les?= =?UTF-8?q?=20d=C3=A9tails=20des=20services=20sans=20cliquer=20sur=20le=20?= =?UTF-8?q?bouton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tarteaucitron.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 2c3b0c1..7d348d6 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -209,6 +209,7 @@ var tarteaucitron = { "bodyPosition": "bottom", "removeCredit": false, "showAlertSmall": false, + "showDetailsOnClick": true, "showIcon": true, "iconPosition": "BottomRight", "cookieslist": false, @@ -383,9 +384,14 @@ var tarteaucitron = { for (i = 0; i < cat.length; i += 1) { html += '
  • '; html += '
    '; - html += ' '; + if(tarteaucitron.parameters.showDetailsOnClick) + { + html += ' '; + }else{ + html += ' ' + tarteaucitron.lang[cat[i]].title + ''; + } html += '
    '; - html += '
    '; + html += '
    '; html += ' ' + tarteaucitron.lang[cat[i]].details; html += '
    '; html += '
    • '; @@ -752,6 +758,7 @@ var tarteaucitron = { for (i = 0; i < toggleBtns.length; i++) { toggleBtns[i].dataset.index = i; tarteaucitron.addClickEventToElement(toggleBtns[i], function () { + if(!tarteaucitron.parameters.showDetailsOnClick) return false; tarteaucitron.userInterface.toggle('tarteaucitronDetails' + cat[this.dataset.index], 'tarteaucitronInfoBox'); if (document.getElementById('tarteaucitronDetails' + cat[this.dataset.index]).style.display === 'block') { this.setAttribute('aria-expanded', 'true');