partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit dbdb4db6aa3dc2b5c08c01c6669bc1628601e698
parent 66317d8e5c48caea9728a90e05c83c9db3709987
Author: felicitus <felicitus@felicitus.org>
Date:   Mon,  9 Jul 2012 00:27:20 +0200

Fixed key binding for the login dialog

Diffstat:
Msrc/frontend/js/Components/Auth/LoginDialog.js | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/frontend/js/Components/Auth/LoginDialog.js b/src/frontend/js/Components/Auth/LoginDialog.js @@ -37,12 +37,6 @@ Ext.define('PartKeepr.LoginDialog', { }); Ext.apply(this, { - // Login when "enter" was hit - keys: [{ - key: Ext.EventObject.ENTER, - handler: this.login, - scope: this - }], items: [ this.loginField, this.passwordField @@ -69,11 +63,19 @@ Ext.define('PartKeepr.LoginDialog', { this.callParent(arguments); + this.on("render", this.assignEnterKey, this); // Focus the login field on show // @workaround Set the focus 100ms after the dialog has been shown. this.on("show", function () { this.loginField.focus(); }, this, { delay: 100 }); }, /** + * Assigns the enter key to the login window. + */ + assignEnterKey: function () { + var keyMap = this.getKeyMap(); + keyMap.on(Ext.EventObject.ENTER, this.login, this); + }, + /** * Fires the "login" event */ login: function () {