12 lines
525 B
JavaScript
12 lines
525 B
JavaScript
/* Asks before the actions that change something (stop a server, pay an invoice...). */
|
|
(function () {
|
|
'use strict';
|
|
document.addEventListener('submit', function (e) {
|
|
var f = e.target;
|
|
if (!f || !f.getAttribute) { return; }
|
|
var q = f.getAttribute('data-interweb-mz-account-confirm');
|
|
if (q && !window.confirm(q)) { e.preventDefault(); return; }
|
|
var b = f.querySelector('button[type="submit"],input[type="submit"]');
|
|
if (b) { setTimeout(function () { b.disabled = true; }, 0); }
|
|
}, true);
|
|
})();
|