Commit e0a6a274 authored by Dietmar Maurer's avatar Dietmar Maurer

fix focus handling for LoginWindow

parent 28210ef5
...@@ -16,7 +16,7 @@ Ext.define('PVE.window.LoginWindow', { ...@@ -16,7 +16,7 @@ Ext.define('PVE.window.LoginWindow', {
me.el.unmask(); me.el.unmask();
Ext.MessageBox.alert('Failure', "Login failed. Please try again", function() { Ext.MessageBox.alert('Failure', "Login failed. Please try again", function() {
var uf = form.findField('username'); var uf = form.findField('username');
uf.focus(true); uf.focus(true, true);
}); });
}, },
success: function(f, resp){ success: function(f, resp){
...@@ -50,7 +50,7 @@ Ext.define('PVE.window.LoginWindow', { ...@@ -50,7 +50,7 @@ Ext.define('PVE.window.LoginWindow', {
fieldDefaults: { fieldDefaults: {
labelWidth: 70, labelWidth: 70,
labelAlign : 'right' labelAlign: 'right'
}, },
defaults: { defaults: {
...@@ -65,8 +65,9 @@ Ext.define('PVE.window.LoginWindow', { ...@@ -65,8 +65,9 @@ Ext.define('PVE.window.LoginWindow', {
name: 'username', name: 'username',
blankText: "Enter your user name", blankText: "Enter your user name",
listeners: { listeners: {
render: function(f) { afterrender: function(f) {
f.focus(true); // Note: only works if we pass delay 1000
f.focus(true, 1000);
}, },
specialkey: function(f, e) { specialkey: function(f, e) {
if (e.getKey() === e.ENTER) { if (e.getKey() === e.ENTER) {
...@@ -85,7 +86,7 @@ Ext.define('PVE.window.LoginWindow', { ...@@ -85,7 +86,7 @@ Ext.define('PVE.window.LoginWindow', {
inputType: 'password', inputType: 'password',
fieldLabel: 'Password', fieldLabel: 'Password',
name: 'password', name: 'password',
blankText:"Enter your password", blankText: "Enter your password",
listeners: { listeners: {
specialkey: function(field, e) { specialkey: function(field, e) {
if (e.getKey() === e.ENTER) { if (e.getKey() === e.ENTER) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment