Implement `_dialogSubmit()` for confirmation dialogs
authorAlexander Ebert <ebert@woltlab.com>
Fri, 9 Apr 2021 09:14:36 +0000 (11:14 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 9 Apr 2021 09:14:36 +0000 (11:14 +0200)
See #3234

wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Confirmation.js

index 055bb9f84c2ba10c6ee534beefe884f68bf84af5..444b782fe806087348ee9fdc2e34d84c2cf2bc5c 100644 (file)
@@ -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();
                }
        };
 });