aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/app/controller/Root.js2
-rw-r--r--web/app/view/LoginController.js6
2 files changed, 5 insertions, 3 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index 81be05a5..eaf98e8f 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -34,7 +34,6 @@ Ext.define('Traccar.controller.Root', {
},
onServerReturn: function (options, success, response) {
- Ext.get('spinner').remove();
if (success) {
Traccar.app.setServer(Ext.decode(response.responseText));
Ext.Ajax.request({
@@ -48,6 +47,7 @@ Ext.define('Traccar.controller.Root', {
},
onSessionReturn: function (options, success, response) {
+ Ext.get('spinner').setVisible(false);
if (success) {
Traccar.app.setUser(Ext.decode(response.responseText));
this.loadApp();
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);
}
}