aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/LoginController.js3
-rw-r--r--web/app/view/StateController.js2
-rw-r--r--web/app/view/UserController.js10
-rw-r--r--web/app/view/UserDialogController.js7
4 files changed, 13 insertions, 9 deletions
diff --git a/web/app/view/LoginController.js b/web/app/view/LoginController.js
index dfff6b253..141905da8 100644
--- a/web/app/view/LoginController.js
+++ b/web/app/view/LoginController.js
@@ -39,9 +39,10 @@
url: '/api/login',
params: form.getValues(),
callback: function (options, success, response) {
+ var result;
Ext.getBody().unmask();
if (Traccar.ErrorManager.check(success, response)) {
- var result = Ext.decode(response.responseText);
+ result = Ext.decode(response.responseText);
if (result.success) {
Traccar.app.setUser(result.data);
this.fireViewEvent('login');
diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js
index ad44d7ac7..9aa23de64 100644
--- a/web/app/view/StateController.js
+++ b/web/app/view/StateController.js
@@ -76,7 +76,7 @@
},
formatValue: function (value) {
- if (typeof(id) === 'number') {
+ if (typeof (id) === 'number') {
return value.toFixed(2);
} else {
return value;
diff --git a/web/app/view/UserController.js b/web/app/view/UserController.js
index d5535bce3..0a6e4f553 100644
--- a/web/app/view/UserController.js
+++ b/web/app/view/UserController.js
@@ -29,15 +29,17 @@
},
onAddClick: function () {
- var user = Ext.create('Traccar.model.User');
- var dialog = Ext.create('Traccar.view.UserDialog');
+ var user, dialog;
+ user = Ext.create('Traccar.model.User'),
+ dialog = Ext.create('Traccar.view.UserDialog');
dialog.down('form').loadRecord(user);
dialog.show();
},
onEditClick: function () {
- var user = this.getView().getSelectionModel().getSelection()[0];
- var dialog = Ext.create('Traccar.view.UserDialog');
+ var user, dialog;
+ user = this.getView().getSelectionModel().getSelection()[0];
+ dialog = Ext.create('Traccar.view.UserDialog');
dialog.down('form').loadRecord(user);
dialog.show();
},
diff --git a/web/app/view/UserDialogController.js b/web/app/view/UserDialogController.js
index 6dbd44fa7..40c88a8b4 100644
--- a/web/app/view/UserDialogController.js
+++ b/web/app/view/UserDialogController.js
@@ -27,13 +27,14 @@
},
onSaveClick: function (button) {
- var dialog = button.up('window').down('form');
+ var dialog, record, store;
+ dialog = button.up('window').down('form');
dialog.updateRecord();
- var record = dialog.getRecord();
+ record = dialog.getRecord();
if (record === Traccar.app.getUser()) {
record.save();
} else {
- var store = Ext.getStore('Users');
+ store = Ext.getStore('Users');
if (record.phantom) {
store.add(record);
}