diff options
author | Abyss777 <abyss@fox5.ru> | 2017-05-04 09:20:02 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-05-04 09:20:02 +0500 |
commit | 26289d388106eed3b75cb1bfd84b0c23f0523a83 (patch) | |
tree | 33249e27b2b27c69af059e0e2354a1ebe9b99d81 /web/app/view/dialog/DeviceDistanceController.js | |
parent | 454541646fa1675e9cf3695fceb5e72c5f5a4fe6 (diff) | |
download | trackermap-web-26289d388106eed3b75cb1bfd84b0c23f0523a83.tar.gz trackermap-web-26289d388106eed3b75cb1bfd84b0c23f0523a83.tar.bz2 trackermap-web-26289d388106eed3b75cb1bfd84b0c23f0523a83.zip |
Use user units in TotalDistance dialog
Diffstat (limited to 'web/app/view/dialog/DeviceDistanceController.js')
-rw-r--r-- | web/app/view/dialog/DeviceDistanceController.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web/app/view/dialog/DeviceDistanceController.js b/web/app/view/dialog/DeviceDistanceController.js index fd106a8d..bd9e059d 100644 --- a/web/app/view/dialog/DeviceDistanceController.js +++ b/web/app/view/dialog/DeviceDistanceController.js @@ -21,7 +21,14 @@ Ext.define('Traccar.view.dialog.DeviceDistanceController', { alias: 'controller.deviceDistance', onDeviceChange: function (combobox, newValue) { + var position; this.lookupReference('setButton').setDisabled(newValue === null); + if (newValue) { + position = Ext.getStore('LatestPositions').findRecord('deviceId', newValue, 0, false, false, true); + if (position) { + this.lookupReference('totalDistance').setValue(position.get('attributes').totalDistance); + } + } }, onSetClick: function (button) { |