aboutsummaryrefslogtreecommitdiff
path: root/web/app/Application.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-08-11 15:03:39 +0500
committerAbyss777 <abyss@fox5.ru>2017-08-11 17:22:15 +0500
commita2b7e07df1cc4548e27c51e1545cf210b0ef0ab7 (patch)
tree61f7ef413962fee8b2c20fafc29ef3e872273ad3 /web/app/Application.js
parent9a536a3ef3b8972c64de2de76a340115ab036d3f (diff)
downloadtrackermap-web-a2b7e07df1cc4548e27c51e1545cf210b0ef0ab7.tar.gz
trackermap-web-a2b7e07df1cc4548e27c51e1545cf210b0ef0ab7.tar.bz2
trackermap-web-a2b7e07df1cc4548e27c51e1545cf210b0ef0ab7.zip
Implement attribute to disable vehicle related UI features
Diffstat (limited to 'web/app/Application.js')
-rw-r--r--web/app/Application.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/web/app/Application.js b/web/app/Application.js
index c14dd4d3..3cee7b78 100644
--- a/web/app/Application.js
+++ b/web/app/Application.js
@@ -104,6 +104,10 @@ Ext.define('Traccar.Application', {
return window.matchMedia && window.matchMedia('(max-width: 768px)').matches;
},
+ isVehicleFeaturesDisabled: function () {
+ return this.getBooleanAttributePreference('ui.disableVehicleFetures');
+ },
+
getEventString: function (eventType) {
var key = 'event' + eventType.charAt(0).toUpperCase() + eventType.slice(1);
return Strings[key] || key;
@@ -161,6 +165,10 @@ Ext.define('Traccar.Application', {
}
},
+ getBooleanAttributePreference: function (key) {
+ return this.getAttributePreference(key, false).toString() === 'true';
+ },
+
getReportColor: function (deviceId) {
var index, reportColor, device = Ext.getStore('Devices').getById(deviceId);
if (device) {