From 3810a8be84b010f6c26f7541be22ecd6a973af58 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 19 Apr 2017 14:17:11 +0500 Subject: Convert speed and distance for known attributes --- web/app/store/SpeedUnits.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/app/store/SpeedUnits.js') diff --git a/web/app/store/SpeedUnits.js b/web/app/store/SpeedUnits.js index a14ab22..ce97695 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) { -- cgit v1.2.3