aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorninioe <ninioe@gmail.com>2016-07-20 08:23:40 +0300
committerninioe <ninioe@gmail.com>2016-07-20 08:23:40 +0300
commit19d51272931f92c5c8a139e8aa8f9aa0314f6c61 (patch)
tree7330320e4221f52c7ebf5ee93d94160ba198e829 /web/app
parent6d1e5f977b211128757aac4dd2da316211cc6fa5 (diff)
downloadtraccar-server-19d51272931f92c5c8a139e8aa8f9aa0314f6c61.tar.gz
traccar-server-19d51272931f92c5c8a139e8aa8f9aa0314f6c61.tar.bz2
traccar-server-19d51272931f92c5c8a139e8aa8f9aa0314f6c61.zip
jshint & jscs cleanup
Diffstat (limited to 'web/app')
-rw-r--r--web/app/AttributeFormatter.js2
-rw-r--r--web/app/controller/Root.js12
-rw-r--r--web/app/view/Devices.js11
3 files changed, 12 insertions, 13 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js
index e14a9539b..c32849101 100644
--- a/web/app/AttributeFormatter.js
+++ b/web/app/AttributeFormatter.js
@@ -37,7 +37,7 @@ Ext.define('Traccar.AttributeFormatter', {
alarmFormatter: function (attributes) {
var value = '';
if (attributes instanceof Object) {//for Traccar.view.Attributes
- if (attributes.hasOwnProperty('alarm')){
+ if (attributes.hasOwnProperty('alarm')) {
value = attributes.alarm;
if (typeof value === 'boolean') {
value = (value ? Ext.Msg.buttonText.yes : Ext.Msg.buttonText.no);
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index 3a7f24bca..90923fe53 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -89,9 +89,9 @@ Ext.define('Traccar.controller.Root', {
}
},
- beep: function() {
- if(this.snd == null){
- this.snd = new Audio("beep.wav");
+ beep: function () {
+ if (this.snd === null) {
+ this.snd = new Audio('beep.wav');
}
this.snd.play();
},
@@ -163,8 +163,8 @@ Ext.define('Traccar.controller.Root', {
text = alarmKey;
}
for (j = 0; j < data.positions.length; j++) {
- if (data.positions[j].id === array[i].positionId && data.positions[j].attributes.alarm != null) {
- if (typeof data.positions[j].attributes.alarm === 'string' && data.positions[j].attributes.alarm.length >= 2){
+ if (data.positions[j].id === array[i].positionId && data.positions[j].attributes.alarm !== null) {
+ if (typeof data.positions[j].attributes.alarm === 'string' && data.positions[j].attributes.alarm.length >= 2) {
alarmKey = 'alarm' + data.positions[j].attributes.alarm.charAt(0).toUpperCase() + data.positions[j].attributes.alarm.slice(1);
text = Strings[alarmKey];
if (typeof text === 'undefined') {
@@ -189,7 +189,7 @@ Ext.define('Traccar.controller.Root', {
}
device = Ext.getStore('Devices').getById(array[i].deviceId);
if (typeof device !== 'undefined') {
- if(self.showAlarmSelected()){
+ if (self.showAlarmSelected()) {
self.beep();
Ext.toast(text, device.getData().name);
}
diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js
index 77d796b1e..31d22ed2a 100644
--- a/web/app/view/Devices.js
+++ b/web/app/view/Devices.js
@@ -64,16 +64,15 @@ Ext.define('Traccar.view.Devices', {
tooltipType: 'title',
pressed : true,
enableToggle: true,
- listeners:{
- toggle: function(button, pressed){
- if(pressed){
+ listeners: {
+ toggle: function (button, pressed) {
+ if (pressed) {
button.setGlyph('xf0a2@FontAwesome');
- }
- else {
+ } else {
button.setGlyph('xf1f7@FontAwesome');
}
},
- scope:this
+ scope: this
}
}, {
id: 'deviceFollowButton',