A confirmation dialog can always be confirmed with return
authorMagnus Kühn <magnus.khn@gmail.com>
Wed, 27 Mar 2013 14:21:52 +0000 (15:21 +0100)
committerMagnus Kühn <magnus.khn@gmail.com>
Wed, 27 Mar 2013 14:21:52 +0000 (15:21 +0100)
wcfsetup/install/files/js/WCF.js

index 5795b3892fb657c8f59d7dadd16b1b0fcbd23d7f..237ef41d3e38d9168313231e2133b32df4f64182 100755 (executable)
@@ -5240,6 +5240,12 @@ WCF.System.Confirmation = {
         */
        _visible: false,
        
+       /**
+        * confirmation button
+        * @var jQuery
+        */
+       _confirmationButton: null,
+       
        /**
         * Displays a confirmation dialog.
         * 
@@ -5283,6 +5289,7 @@ WCF.System.Confirmation = {
                        this._dialog.wcfDialog('render');
                }
                
+               this._confirmationButton.focus();
                this._visible = true;
        },
        
@@ -5293,7 +5300,7 @@ WCF.System.Confirmation = {
                this._dialog = $('<div id="wcfSystemConfirmation" class="systemConfirmation"><p /><div id="wcfSystemConfirmationContent" /></div>').hide().appendTo(document.body);
                var $formButtons = $('<div class="formSubmit" />').appendTo(this._dialog);
                
-               $('<button class="buttonPrimary">' + WCF.Language.get('wcf.global.confirmation.confirm') + '</button>').data('action', 'confirm').click($.proxy(this._click, this)).appendTo($formButtons);
+               this._confirmationButton = $('<button class="buttonPrimary">' + WCF.Language.get('wcf.global.confirmation.confirm') + '</button>').data('action', 'confirm').click($.proxy(this._click, this)).appendTo($formButtons);
                $('<button>' + WCF.Language.get('wcf.global.confirmation.cancel') + '</button>').data('action', 'cancel').click($.proxy(this._click, this)).appendTo($formButtons);
        },