aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
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',