From 63e5690c22dc5911a8ec5cfe1b44c8a5a8576456 Mon Sep 17 00:00:00 2001 From: ninioe Date: Tue, 2 Aug 2016 07:32:04 +0300 Subject: use of extjs references instead of global ids --- web/app/view/LoginController.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'web/app/view/LoginController.js') diff --git a/web/app/view/LoginController.js b/web/app/view/LoginController.js index 3b4fc8754..c33af328e 100644 --- a/web/app/view/LoginController.js +++ b/web/app/view/LoginController.js @@ -29,8 +29,8 @@ Ext.define('Traccar.view.LoginController', { var user = Ext.util.Cookies.get('user'); var pass = Ext.util.Cookies.get('pass'); if (user && pass) { - Ext.getCmp('txtUser').setValue(user); - Ext.getCmp('txtPassword').setValue(pass); + this.lookupReference('txtUser').setValue(user); + this.lookupReference('txtPassword').setValue(pass); this.login(); } }, @@ -47,9 +47,9 @@ Ext.define('Traccar.view.LoginController', { callback: function (options, success, response) { Ext.getBody().unmask(); if (success) { - if (Ext.getCmp('chkRememberMe').getValue()) { - Ext.util.Cookies.set('user', Ext.getCmp('txtUser').getValue(), Ext.Date.add(new Date(), Ext.Date.YEAR, 1)); - Ext.util.Cookies.set('pass', Ext.getCmp('txtPassword').getValue(), Ext.Date.add(new Date(), Ext.Date.YEAR, 1)); + if (this.lookupReference('chkRememberMe').getValue()) { + Ext.util.Cookies.set('user', this.lookupReference('txtUser').getValue(), Ext.Date.add(new Date(), Ext.Date.YEAR, 1)); + Ext.util.Cookies.set('pass', this.lookupReference('txtPassword').getValue(), Ext.Date.add(new Date(), Ext.Date.YEAR, 1)); } Traccar.app.setUser(Ext.decode(response.responseText)); this.fireViewEvent('login'); -- cgit v1.2.3