aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-06 09:53:50 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-06 09:53:50 +1300
commit94d9ab6b5857cc5638f07155a6b45403dbc468bf (patch)
tree93cba417a5ee10798ae852568dc156ff8addb9ab /web/app/view
parent939a75a9378328bd6acae260e745d44f031d5ff0 (diff)
downloadtrackermap-web-94d9ab6b5857cc5638f07155a6b45403dbc468bf.tar.gz
trackermap-web-94d9ab6b5857cc5638f07155a6b45403dbc468bf.tar.bz2
trackermap-web-94d9ab6b5857cc5638f07155a6b45403dbc468bf.zip
Make login flow nicer
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/LoginController.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/app/view/LoginController.js b/web/app/view/LoginController.js
index e175c0c3..fbc703e9 100644
--- a/web/app/view/LoginController.js
+++ b/web/app/view/LoginController.js
@@ -32,14 +32,15 @@ Ext.define('Traccar.view.LoginController', {
login: function () {
var form = this.lookupReference('form');
if (form.isValid()) {
- Ext.getBody().mask(Strings.sharedLoading);
+ Ext.get('spinner').setVisible(true);
+ this.getView().setVisible(false);
Ext.Ajax.request({
scope: this,
method: 'POST',
url: 'api/session',
params: form.getValues(),
callback: function (options, success, response) {
- Ext.getBody().unmask();
+ Ext.get('spinner').setVisible(false);
if (success) {
if (this.lookupReference('rememberField').getValue()) {
Ext.util.Cookies.set('user', this.lookupReference('userField').getValue(), Ext.Date.add(new Date(), Ext.Date.YEAR, 1));
@@ -48,6 +49,7 @@ Ext.define('Traccar.view.LoginController', {
Traccar.app.setUser(Ext.decode(response.responseText));
this.fireViewEvent('login');
} else {
+ this.getView().setVisible(true);
Traccar.app.showError(Strings.loginFailed);
}
}