aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/StateController.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/StateController.js')
-rw-r--r--web/app/view/StateController.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js
index c6c1507d..0ce8b1f5 100644
--- a/web/app/view/StateController.js
+++ b/web/app/view/StateController.js
@@ -50,11 +50,20 @@ Ext.define('Traccar.view.StateController', {
init: function () {
+ var i, hiddenAttributesPreference, attributesList;
if (Traccar.app.getUser().get('admin') ||
!Traccar.app.getUser().get('deviceReadonly') && !Traccar.app.getPreference('readonly', false)) {
this.lookupReference('computedAttributesButton').setDisabled(
Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes'));
}
+ hiddenAttributesPreference = Traccar.app.getAttributePreference('ui.hiddenPositionAttributes');
+ this.hiddenAttributes = {};
+ if (hiddenAttributesPreference) {
+ attributesList = hiddenAttributesPreference.split(/[ ,]+/).filter(Boolean);
+ for (i = 0; i < attributesList.length; i++) {
+ this.hiddenAttributes[attributesList[i]] = true;
+ }
+ }
},
onComputedAttributesClick: function () {
@@ -124,7 +133,7 @@ Ext.define('Traccar.view.StateController', {
attributes = this.position.get('attributes');
if (attributes instanceof Object) {
for (key in attributes) {
- if (attributes.hasOwnProperty(key)) {
+ if (attributes.hasOwnProperty(key) && !this.hiddenAttributes[key]) {
this.lookupAttribute = key;
name = Ext.getStore('PositionAttributes').getAttributeName(key, true);
if (this.position.get('attribute.' + key) !== undefined) {