fix: coquille sur le typeof de charger_require

This commit is contained in:
Christophe 2024-04-15 20:29:41 +02:00
parent bb6b31d9b7
commit 2d810faf27

View file

@ -4,45 +4,45 @@
* Imposer le style sur le premier bloc englobant dans la madiabox (style="width: [(#ENV{largeur})])
*/
jQuery(function () {
modalbox();
modalbox();
function modalbox() {
$('body').on('click', '.modalbox, .modalgamutable', function (e) {
e.stopPropagation();
e.preventDefault();
let ts = + new Date()
let url = $(this).attr('href');
url += '&var_zajax=content';
url += '&ts=' + ts;
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';
}
function modalbox() {
$('body').on('click', '.modalbox, .modalgamutable', function (e) {
e.stopPropagation();
e.preventDefault();
let ts = + new Date()
let url = $(this).attr('href');
url += '&var_zajax=content';
url += '&ts=' + ts;
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';
}
let that = this;
data.onShow = () => {
if (typeof charger_require !== undefined) {
charger_require();
}
let that = this;
data.onShow = () => {
if (typeof charger_require !== 'undefined') {
charger_require();
}
if ($(that).hasClass('modalgamutable')) {
if (typeof window.gamutable !== 'undefined') {
window.gamutable();
}
}
};
$.modalbox(url, data);
});
}
if ($(that).hasClass('modalgamutable')) {
if (typeof window.gamutable !== 'undefined') {
window.gamutable();
}
}
};
$.modalbox(url, data);
});
}
});