Loading public/js/pop-ajax.js +62 −4 Changes for public/js/pop-ajax.js: 62 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -300,7 +300,63 @@ $(function () { }); // Recours à l'utilisation du popConform standard function popConfirm(element, options) { if (typeof options == 'function') { options = { confirm: options }; } if (!options) { options = {}; } if (!options.title) { options.title = element.dataset.title; } if (!options.title) { options.title = "Demande de confirmation"; } if (!options.content) { options.content = element.dataset.content; } if (!options.content) { options.content = "Confirmez-vous cette action ?"; } if (!options.confirm) { options.confirm = () => { }; } if (!options.url) { options.url = element.href; } if (!options.url) { options.url = element.dataset.url; } if (options.url) { goFunc = () => { unicaenVue.axios.get(options.url).then(response => { options.confirm(response, element); }); }; } else { goFunc = () => { options.confirm(element); }; } if (confirm(options.content)){ goFunc(); } } // ancien popConform sauvegardé function popConfirmOld(element, options) { var popConfirm = bootstrap.Popover.getInstance(element); if (!popConfirm) { Loading Loading @@ -328,7 +384,8 @@ function popConfirm(element, options) } if (!options.confirm) { options.confirm = function () {}; options.confirm = () => { }; } if (!options.url) { options.url = element.href; Loading @@ -338,15 +395,15 @@ function popConfirm(element, options) } if (options.url) { goFunc = function () { goFunc = () => { unicaenVue.axios.get(options.url).then(response => { options.confirm(response, element); }); }; } else { goFunc = function () { goFunc = () => { options.confirm(element); } }; } let popoptions = { Loading @@ -366,6 +423,7 @@ function popConfirm(element, options) goButton.addEventListener('click', () => { popConfirm.hide(); $("#" + popDivId).remove(); goFunc(); }); Loading Loading
public/js/pop-ajax.js +62 −4 Changes for public/js/pop-ajax.js: 62 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -300,7 +300,63 @@ $(function () { }); // Recours à l'utilisation du popConform standard function popConfirm(element, options) { if (typeof options == 'function') { options = { confirm: options }; } if (!options) { options = {}; } if (!options.title) { options.title = element.dataset.title; } if (!options.title) { options.title = "Demande de confirmation"; } if (!options.content) { options.content = element.dataset.content; } if (!options.content) { options.content = "Confirmez-vous cette action ?"; } if (!options.confirm) { options.confirm = () => { }; } if (!options.url) { options.url = element.href; } if (!options.url) { options.url = element.dataset.url; } if (options.url) { goFunc = () => { unicaenVue.axios.get(options.url).then(response => { options.confirm(response, element); }); }; } else { goFunc = () => { options.confirm(element); }; } if (confirm(options.content)){ goFunc(); } } // ancien popConform sauvegardé function popConfirmOld(element, options) { var popConfirm = bootstrap.Popover.getInstance(element); if (!popConfirm) { Loading Loading @@ -328,7 +384,8 @@ function popConfirm(element, options) } if (!options.confirm) { options.confirm = function () {}; options.confirm = () => { }; } if (!options.url) { options.url = element.href; Loading @@ -338,15 +395,15 @@ function popConfirm(element, options) } if (options.url) { goFunc = function () { goFunc = () => { unicaenVue.axios.get(options.url).then(response => { options.confirm(response, element); }); }; } else { goFunc = function () { goFunc = () => { options.confirm(element); } }; } let popoptions = { Loading @@ -366,6 +423,7 @@ function popConfirm(element, options) goButton.addEventListener('click', () => { popConfirm.hide(); $("#" + popDivId).remove(); goFunc(); }); Loading