From 9fd527f46511bd6c5469fa502092a9a5ffdf45d5 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Wed, 18 Apr 2012 13:00:14 +0100 Subject: [PATCH] WebUI: Increase focus delay for password field cursor --- deluge/ui/web/js/deluge-all/LoginWindow.js | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/LoginWindow.js b/deluge/ui/web/js/deluge-all/LoginWindow.js index 0b710f029..de77fd78f 100644 --- a/deluge/ui/web/js/deluge-all/LoginWindow.js +++ b/deluge/ui/web/js/deluge-all/LoginWindow.js @@ -1,6 +1,6 @@ /*! * Deluge.LoginWindow.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -31,7 +31,7 @@ */ Deluge.LoginWindow = Ext.extend(Ext.Window, { - + firstShow: true, bodyStyle: 'padding: 10px 5px;', buttonAlign: 'center', @@ -45,17 +45,17 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, { title: _('Login'), width: 300, height: 120, - + initComponent: function() { Deluge.LoginWindow.superclass.initComponent.call(this); this.on('show', this.onShow, this); - + this.addButton({ text: _('Login'), handler: this.onLogin, scope: this }); - + this.form = this.add({ xtype: 'form', baseCls: 'x-plain', @@ -74,7 +74,7 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, { }); this.passwordField.on('specialkey', this.onSpecialKey, this); }, - + logout: function() { deluge.events.fire('logout'); deluge.client.auth.delete_session({ @@ -84,17 +84,17 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, { scope: this }); }, - + show: function(skipCheck) { if (this.firstShow) { deluge.client.on('error', this.onClientError, this); this.firstShow = false; } - + if (skipCheck) { return Deluge.LoginWindow.superclass.show.call(this); } - + deluge.client.auth.check_session({ success: function(result) { if (result) { @@ -109,11 +109,11 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, { scope: this }); }, - + onSpecialKey: function(field, e) { if (e.getKey() == 13) this.onLogin(); }, - + onLogin: function() { var passwordField = this.passwordField; deluge.client.auth.login(passwordField.getValue(), { @@ -139,15 +139,15 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, { scope: this }); }, - + onClientError: function(errorObj, response, requestOptions) { if (errorObj.error.code == 1) { deluge.events.fire('logout'); this.show(true); } }, - + onShow: function() { - this.passwordField.focus(true, 100); + this.passwordField.focus(true, 300); } });