From: Alexander Ebert Date: Fri, 9 Apr 2021 09:14:36 +0000 (+0200) Subject: Implement `_dialogSubmit()` for confirmation dialogs X-Git-Tag: 5.3.6~27 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1009e6b113025bdd426ea1613b82dc26d0c1959e;p=GitHub%2FWoltLab%2FWCF.git Implement `_dialogSubmit()` for confirmation dialogs See #3234 --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Confirmation.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Confirmation.js index 055bb9f84c..444b782fe8 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Confirmation.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Confirmation.js @@ -114,9 +114,9 @@ define(['Core', 'Language', 'Ui/Dialog'], function(Core, Language, UiDialog) { dialog.appendChild(formSubmit); _confirmButton = elCreate('button'); + _confirmButton.dataset.type = "submit"; _confirmButton.classList.add('buttonPrimary'); _confirmButton.textContent = Language.get('wcf.global.confirmation.confirm'); - _confirmButton.addEventListener(WCF_CLICK_EVENT, this._confirm.bind(this)); formSubmit.appendChild(_confirmButton); var cancelButton = elCreate('button'); @@ -165,6 +165,10 @@ define(['Core', 'Language', 'Ui/Dialog'], function(Core, Language, UiDialog) { _onShow: function() { _confirmButton.blur(); _confirmButton.focus(); + }, + + _dialogSubmit: function() { + this._confirm(); } }; });