aboutsummaryrefslogtreecommitdiff
path: root/web/app/AttributeFormatter.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/AttributeFormatter.js')
-rw-r--r--web/app/AttributeFormatter.js29
1 files changed, 4 insertions, 25 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js
index 253dadb53..4b6cb5755 100644
--- a/web/app/AttributeFormatter.js
+++ b/web/app/AttributeFormatter.js
@@ -34,30 +34,11 @@ Ext.define('Traccar.AttributeFormatter', {
return Ext.getStore('DistanceUnits').formatValue(value, Traccar.app.getPreference('distanceUnit'));
},
- alarmFormatter: function (attributes) {
- if (attributes instanceof Object) {
- if (attributes.hasOwnProperty('alarm')){
- var value = attributes.alarm;
- if (typeof value === 'boolean') {
- value = (value ? Ext.Msg.buttonText.yes : Ext.Msg.buttonText.no);
- }
- return '<span style="color:red;">' + value + '</span>';
- }
- }
- return '';
- },
-
- alarmTypeFormatter: function (attributes) {
- var alatmType = '';
- if (attributes instanceof Object) {
- for (key in attributes) {
- if (attributes.hasOwnProperty(key) && key.toLowerCase()=='alarm-type') {
- alatmType = attributes[key];
- break;
- }
- }
+ alarmFormatter: function (value) {
+ if (typeof value === 'boolean') {
+ value = (value ? Ext.Msg.buttonText.yes : Ext.Msg.buttonText.no);
}
- return '<span style="color:red;">' + alatmType + '</span>';
+ return '<span style="color:red;">' + value + '</span>';
},
defaultFormatter: function (value) {
@@ -86,8 +67,6 @@ Ext.define('Traccar.AttributeFormatter', {
return this.distanceFormatter;
} else if (key === 'alarm') {
return this.alarmFormatter;
- } else if (key === 'alarm-type') {
- return this.alarmTypeFormatter;
} else {
return this.defaultFormatter;
}