make enter check the password

This commit is contained in:
Damien Churchill 2009-02-12 00:14:59 +00:00
parent d0020344f1
commit 345b28935f
1 changed files with 24 additions and 14 deletions

View File

@ -1,18 +1,4 @@
Deluge.Login = { Deluge.Login = {
Form: new Ext.form.FormPanel({
defaultType: 'textfield',
id: 'loginForm',
baseCls: 'x-plain',
labelWidth: 55,
items: [{
fieldLabel: _('Password'),
id: 'password',
name: 'password',
inputType: 'password',
anchor: '100%'
}]
}),
onLogin: function() { onLogin: function() {
var passwordField = Deluge.Login.Form.items.get('password'); var passwordField = Deluge.Login.Form.items.get('password');
Deluge.Client.web.login(passwordField.getValue(), { Deluge.Client.web.login(passwordField.getValue(), {
@ -30,9 +16,33 @@ Deluge.Login = {
} }
} }
}); });
},
onKey: function(field, e) {
if (e.getKey() == 13) Deluge.Login.onLogin();
} }
} }
Deluge.Login.Form = new Ext.form.FormPanel({
defaultType: 'textfield',
id: 'loginForm',
baseCls: 'x-plain',
labelWidth: 55,
items: [{
fieldLabel: _('Password'),
id: 'password',
name: 'password',
inputType: 'password',
anchor: '100%',
listeners: {
'specialkey': {
fn: Deluge.Login.onKey,
scope: Deluge.Login
}
}
}]
});
Deluge.Login.Window = new Ext.Window({ Deluge.Login.Window = new Ext.Window({
layout: 'fit', layout: 'fit',
width: 300, width: 300,