From 1009e6b113025bdd426ea1613b82dc26d0c1959e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 9 Apr 2021 11:14:36 +0200 Subject: [PATCH] Implement `_dialogSubmit()` for confirmation dialogs See #3234 --- .../install/files/js/WoltLabSuite/Core/Ui/Confirmation.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); } }; }); -- 2.20.1