From a2b7e07df1cc4548e27c51e1545cf210b0ef0ab7 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 11 Aug 2017 15:03:39 +0500 Subject: Implement attribute to disable vehicle related UI features --- web/app/Application.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'web/app/Application.js') 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) { -- cgit v1.2.3