Fix cancel button of form builder dialogs
authorMatthias Schmidt <gravatronics@live.com>
Thu, 20 Jun 2019 08:42:04 +0000 (10:42 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 20 Jun 2019 08:42:04 +0000 (10:42 +0200)
See #2509

wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Dialog.js

index 20f3844ddcb70443799f5742391a2cfb745a9929..6bf2009b8c2e1b9e45c9ae9163376832107953ef 100644 (file)
@@ -136,7 +136,7 @@ define(['Ajax', 'Core', './Manager', 'Ui/Dialog'], function(Ajax, Core, FormBuil
                 * @param       {HTMLElement}   content         dialog's content element
                 */
                _dialogOnSetup: function(content) {
-                       var cancelButton = elById(this._formId + '_cancelButton', content);
+                       var cancelButton = elBySel('button[data-type=cancel]', content);
                        if (cancelButton !== null) {
                                cancelButton.addEventListener('click', this._closeDialog.bind(this));
                        }