From d82f0b9e0e0966d31009eb4d70e32543bc288dfd Mon Sep 17 00:00:00 2001 From: tofulm Date: Mon, 19 Apr 2021 23:30:19 +0200 Subject: [PATCH] modalbox, on charge mon_site.js --- js/gamutable.es6.js | 5 +++++ js/gamutable.js | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/js/gamutable.es6.js b/js/gamutable.es6.js index be7d32b..1c346bd 100644 --- a/js/gamutable.es6.js +++ b/js/gamutable.es6.js @@ -56,7 +56,12 @@ jQuery(function () { let width = $(this).data('width'); if (width !== undefined) { data.width = width; + let valeur_reduite = ($(window).width() * width) / 100; + url += '&largeur=' + valeur_reduite + 'px'; } + data.onShow = () => { + jQuery.getScript('local/mon_site.js'); + }; $.modalbox(url, data); }); diff --git a/js/gamutable.js b/js/gamutable.js index e4141c7..2c3457d 100644 --- a/js/gamutable.js +++ b/js/gamutable.js @@ -89,8 +89,14 @@ jQuery(function () { if (width !== undefined) { data.width = width; + var valeur_reduite = $(window).width() * width / 100; + url += '&largeur=' + valeur_reduite + 'px'; } + data.onShow = function () { + jQuery.getScript('local/mon_site.js'); + }; + $.modalbox(url, data); }); // lancement d'une médiabox