Supporting "Enter" to submit forms during package installation
authorAlexander Ebert <ebert@woltlab.com>
Mon, 29 Jul 2013 16:35:23 +0000 (18:35 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 29 Jul 2013 16:35:23 +0000 (18:35 +0200)
wcfsetup/install/files/acp/js/WCF.ACP.js

index c2c503ccb971edde73e591d70ebea6802982aa4e..c646992f314ddb2820cf864ed075aed8ab31f39f 100644 (file)
@@ -571,11 +571,17 @@ WCF.ACP.Package.Installation = Class.extend({
                                this._setIcon('question');
                                
                                var $form = $('<div class="formSubmit" />').appendTo($('#packageInstallationInnerContent'));
-                               $('<button class="buttonPrimary">' + WCF.Language.get('wcf.global.button.next') + '</button>').appendTo($form).click($.proxy(function(event) {
+                               var $button = $('<button class="buttonPrimary">' + WCF.Language.get('wcf.global.button.next') + '</button>').appendTo($form).click($.proxy(function(event) {
                                        $(event.currentTarget).disable();
                                        
                                        this._submit(data);
-                               }, this)); 
+                               }, this));
+                               
+                               $(document).keydown(function(event) {
+                                       if (event.which === $.ui.keyCode.ENTER) {
+                                               $button.trigger('click');
+                                       }
+                               });
                        }
                        
                        $('#packageInstallationInnerContentContainer').show();