]> source.dussan.org Git - nextcloud-server.git/commitdiff
Submit on enter
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 16 Nov 2016 08:52:11 +0000 (09:52 +0100)
committerLukas Reschke <lukas@statuscode.ch>
Fri, 18 Nov 2016 11:10:51 +0000 (12:10 +0100)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
core/js/js.js

index e8f6df4cfa9b1e41f0830c47da9bfbf7cc7a2551..4579fe394af32123a809203b428f1fb4eb59bbad 100644 (file)
@@ -1524,6 +1524,7 @@ OC.PasswordConfirmation = {
        callback: null,
 
        init: function() {
+               var self = this;
                this.$form = $('#sudo-login-form');
                this.$background = $('#sudo-login-background');
                this.$input = this.$form.find('.question');
@@ -1532,6 +1533,11 @@ OC.PasswordConfirmation = {
                this.$background.on('click', _.bind(this._fadeOut, this));
                $('.password-confirm-required').on('click', _.bind(this.requirePasswordConfirmation, this));
                this.$submit.on('click', _.bind(this._submitPasswordConfirmation, this));
+               this.$input.keyup(function(e) {
+                       if (e.keyCode === 13) {
+                               self._submitPasswordConfirmation();
+                       }
+               });
        },
 
        requiresPasswordConfirmation: function() {