diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-09-06 09:53:06 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-09-06 09:53:06 +1200 |
commit | ae9de5a7b9cf43ad488022675d243a4b7a863aa4 (patch) | |
tree | c2880267bca7fe494c294d5ae59e15a9ad0e5a2d /web/app/view/StateController.js | |
parent | 00e840b3dbc087a0b187f283d14f5169a626da93 (diff) | |
download | trackermap-web-ae9de5a7b9cf43ad488022675d243a4b7a863aa4.tar.gz trackermap-web-ae9de5a7b9cf43ad488022675d243a4b7a863aa4.tar.bz2 trackermap-web-ae9de5a7b9cf43ad488022675d243a4b7a863aa4.zip |
Add attributes button to state toolbar
Diffstat (limited to 'web/app/view/StateController.js')
-rw-r--r-- | web/app/view/StateController.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js index 3bf76717..c6c1507d 100644 --- a/web/app/view/StateController.js +++ b/web/app/view/StateController.js @@ -22,7 +22,9 @@ Ext.define('Traccar.view.StateController', { requires: [ 'Traccar.AttributeFormatter', 'Traccar.model.Attribute', - 'Traccar.model.Position' + 'Traccar.model.Position', + 'Traccar.view.BaseWindow', + 'Traccar.view.edit.ComputedAttributes' ], config: { @@ -46,6 +48,24 @@ Ext.define('Traccar.view.StateController', { } }, + + init: function () { + 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')); + } + }, + + onComputedAttributesClick: function () { + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedComputedAttributes, + items: { + xtype: 'computedAttributesView' + } + }).show(); + }, + keys: (function () { var i, list, result; result = {}; |