diff options
author | ninioe <ninioe@gmail.com> | 2016-07-17 09:54:15 +0300 |
---|---|---|
committer | ninioe <ninioe@gmail.com> | 2016-07-17 09:54:15 +0300 |
commit | 4d55b911bd252c90d1d0ec4053d8502154192676 (patch) | |
tree | 5cb88f24fb5ba9edbec1bd0593ed2878c401bb2d /web/app/AttributeFormatter.js | |
parent | 636f6e19b4ae7fbd80ff083498fface8c12ee9c8 (diff) | |
download | traccar-server-4d55b911bd252c90d1d0ec4053d8502154192676.tar.gz traccar-server-4d55b911bd252c90d1d0ec4053d8502154192676.tar.bz2 traccar-server-4d55b911bd252c90d1d0ec4053d8502154192676.zip |
Added AlertEventHandler & Mute button for all notifications
Diffstat (limited to 'web/app/AttributeFormatter.js')
-rw-r--r-- | web/app/AttributeFormatter.js | 29 |
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; } |