diff options
author | Abyss777 <abyss@fox5.ru> | 2017-04-19 14:17:11 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-04-19 14:17:11 +0500 |
commit | 3810a8be84b010f6c26f7541be22ecd6a973af58 (patch) | |
tree | a266c3fad333c50d0c1361ccc358fd685625ea01 /web/app/store/SpeedUnits.js | |
parent | 648d5fe1e4a0d92b79410572d386dac45b4e8d36 (diff) | |
download | trackermap-web-3810a8be84b010f6c26f7541be22ecd6a973af58.tar.gz trackermap-web-3810a8be84b010f6c26f7541be22ecd6a973af58.tar.bz2 trackermap-web-3810a8be84b010f6c26f7541be22ecd6a973af58.zip |
Convert speed and distance for known attributes
Diffstat (limited to 'web/app/store/SpeedUnits.js')
-rw-r--r-- | web/app/store/SpeedUnits.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/web/app/store/SpeedUnits.js b/web/app/store/SpeedUnits.js index a14ab22d..ce976952 100644 --- a/web/app/store/SpeedUnits.js +++ b/web/app/store/SpeedUnits.js @@ -33,13 +33,13 @@ Ext.define('Traccar.store.SpeedUnits', { factor: 1.15078 }], - convertValue: function (value, unit) { + convertValue: function (value, unit, back) { var model; if (!unit) { unit = 'kn'; } model = this.findRecord('key', unit); - return value * model.get('factor'); + return back ? value / model.get('factor') : value * model.get('factor'); }, formatValue: function (value, unit) { |