From 8a05651fb28b948bab8e3f39f0724dac0c78adda Mon Sep 17 00:00:00 2001 From: tofulm Date: Thu, 12 Mar 2020 11:37:53 +0100 Subject: [PATCH] pour lancer une mediabox ou modalbox, il faut passer en js, donc on intercepte l'event sur a.mediabox ou a.modalbox --- js/gamutable.es6.js | 13 +++++++++++++ js/gamutable.js | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/js/gamutable.es6.js b/js/gamutable.es6.js index 25ae577..c0fc0c0 100644 --- a/js/gamutable.es6.js +++ b/js/gamutable.es6.js @@ -10,6 +10,19 @@ jQuery(function() { app.rechargerJson(); }); }); + + $('#app').on('click', '.modalbox', function(e) { + e.preventDefault(); + let url = $(this).attr('href'); + url += '&var_zajax=content'; + $.modalbox(url); + }); + + $('#app').on('click', '.mediabox', function(e) { + e.preventDefault(); + let href = $(this).attr('href'); + $.fn.mediabox({ href }); + }); }); function recupJson(d) { try { diff --git a/js/gamutable.js b/js/gamutable.js index a6b19fc..ac571e7 100644 --- a/js/gamutable.js +++ b/js/gamutable.js @@ -20,6 +20,19 @@ jQuery(function () { app.rechargerJson(); }); }); + $('#app').on('click', '.modalbox', function (e) { + e.preventDefault(); + var url = $(this).attr('href'); + url += '&var_zajax=content'; + $.modalbox(url); + }); + $('#app').on('click', '.mediabox', function (e) { + e.preventDefault(); + var href = $(this).attr('href'); + $.fn.mediabox({ + href: href + }); + }); }); function recupJson(d) {