diff --git a/formulaires/configurer_gamutable.html b/formulaires/configurer_gamutable.html index 6058d71..d2848e6 100644 --- a/formulaires/configurer_gamutable.html +++ b/formulaires/configurer_gamutable.html @@ -9,24 +9,20 @@
#ACTION_FORMULAIRE
- #SET{name,version_js} + #SET{name,charger_modalbox} #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}} - #SET{obli,"obligatoire"}
+
- - -

js/vue.min.js - 92ko (sans le debug)

-
-
- - -

js/vue.js - 276ko

+ + +

Si un lien à la classe .modalbox, appelle un sq dans content

+

 

diff --git a/inclure/gamutable.html b/inclure/gamutable.html index 3663bda..8fffb27 100644 --- a/inclure/gamutable.html +++ b/inclure/gamutable.html @@ -93,4 +93,10 @@ + + +[(#CONFIG{gamutable/charger_modalbox}|=={oui}|oui) + +] + diff --git a/js/gamubox.js b/js/gamubox.js new file mode 100644 index 0000000..c7e66f6 --- /dev/null +++ b/js/gamubox.js @@ -0,0 +1,38 @@ +/* + * Pour parametrer la largeur : + * Indiquer le data-width sur le lien (exmeple data-width= "90") + * Imposer le style sur le premier bloc englobant dans la madiabox (style="width: [(#ENV{largeur})]) + */ +jQuery(function () { + modalbox(); + + function modalbox() { + $('body').on('click', '.modalbox', function (e) { + e.stopPropagation(); + e.preventDefault(); + let url = $(this).attr('href'); + url += '&var_zajax=content'; + let data = {}; + let minHeight = $(this).data('minheight'); + let minWidth = $(this).data('minwidth'); + if (minHeight !== undefined) { + data.minHeight = minHeight; + } + if (minWidth !== undefined) { + data.minWidth = minWidth; + } + 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 = () => { + if (typeof charger_require !== undefined) { + charger_require(); + } + }; + $.modalbox(url, data); + }); + } +}); diff --git a/paquet.xml b/paquet.xml index b78bd3c..3f823c2 100644 --- a/paquet.xml +++ b/paquet.xml @@ -1,7 +1,7 @@