From 38134454c55b4a36f7c82686e3a29a9610050e6e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 8 Nov 2015 14:33:48 +1300 Subject: Fix JavaScript check style issues --- web/app/view/LoginController.js | 11 ++++++----- web/app/view/Map.js | 2 +- web/app/view/MapController.js | 5 +++-- web/app/view/UsersController.js | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) (limited to 'web/app/view') diff --git a/web/app/view/LoginController.js b/web/app/view/LoginController.js index e0dbcce88..cd5a174d5 100644 --- a/web/app/view/LoginController.js +++ b/web/app/view/LoginController.js @@ -65,12 +65,13 @@ Ext.define('Traccar.view.LoginController', { }, onSelectLanguage: function (selected) { - var paramName = 'locale'; - var paramValue = selected.getValue(); - var url = window.location.href; + var paramName, paramValue, url, prefix, suffix; + paramName = 'locale'; + paramValue = selected.getValue(); + url = window.location.href; if (url.indexOf(paramName + '=') >= 0) { - var prefix = url.substring(0, url.indexOf(paramName)); - var suffix = url.substring(url.indexOf(paramName)); + prefix = url.substring(0, url.indexOf(paramName)); + suffix = url.substring(url.indexOf(paramName)); suffix = suffix.substring(suffix.indexOf('=') + 1); suffix = (suffix.indexOf('&') >= 0) ? suffix.substring(suffix.indexOf('&')) : ''; url = prefix + paramName + '=' + paramValue + suffix; diff --git a/web/app/view/Map.js b/web/app/view/Map.js index 4358b64ac..8df5db1d9 100644 --- a/web/app/view/Map.js +++ b/web/app/view/Map.js @@ -96,7 +96,7 @@ Ext.define('Traccar.view.Map', { view: this.mapView }); - this.map.on('click', function(e) { + this.map.on('click', function (e) { this.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) { this.fireEvent('selectFeature', feature); }, this); diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js index aa27aff74..9ccc3d57c 100644 --- a/web/app/view/MapController.js +++ b/web/app/view/MapController.js @@ -118,7 +118,8 @@ Ext.define('Traccar.view.MapController', { }, clearReport: function (store) { - var vectorSource = this.getView().getVectorSource(); + var vectorSource, key; + vectorSource = this.getView().getVectorSource(); if (this.reportRoute) { vectorSource.removeFeature(this.reportRoute); @@ -126,7 +127,7 @@ Ext.define('Traccar.view.MapController', { } if (this.reportMarkers) { - for (var key in this.reportMarkers) { + for (key in this.reportMarkers) { if (this.reportMarkers.hasOwnProperty(key)) { vectorSource.removeFeature(this.reportMarkers[key]); } diff --git a/web/app/view/UsersController.js b/web/app/view/UsersController.js index 30eb8b1a5..3d0e813e8 100644 --- a/web/app/view/UsersController.js +++ b/web/app/view/UsersController.js @@ -55,8 +55,8 @@ Ext.define('Traccar.view.UsersController', { no: Strings.sharedCancel }, fn: function (btn) { + var store = Ext.getStore('Users'); if (btn === 'yes') { - var store = Ext.getStore('Users'); store.remove(user); store.sync(); } -- cgit v1.2.3