From: Matthias Schmidt Date: Thu, 20 Jun 2019 15:16:09 +0000 (+0200) Subject: Disable form builder dialog submit button after submitting form X-Git-Tag: 5.2.0_Alpha_1~31^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=615337b6090b09704cd95441e3c966335db36384;p=GitHub%2FWoltLab%2FWCF.git Disable form builder dialog submit button after submitting form See #2509 --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Dialog.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Dialog.js index 96528008a9..bff5c5b02c 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Dialog.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Dialog.js @@ -176,10 +176,14 @@ define(['Ajax', 'Core', './Manager', 'Ui/Dialog'], function(Ajax, Core, FormBuil * @param {object} formData */ _submitForm: function(formData) { + var submitButton = elBySel('button[data-type=submit]', UiDialog.getDialog(this).content); + if (typeof this._options.onSubmit === 'function') { - this._options.onSubmit(formData); + this._options.onSubmit(formData, submitButton); } else if (typeof this._options.submitActionName === 'string') { + submitButton.disabled = true; + Ajax.api(this, { actionName: this._options.submitActionName, parameters: {