From 9a14f9599659c587a646ee322db5b65fa65d801d Mon Sep 17 00:00:00 2001 From: Evgeny S Maksimov Date: Mon, 25 Feb 2019 20:46:48 +0300 Subject: Add connection between event and its state --- web/app/view/StateController.js | 9 +++++++++ web/app/view/map/MapMarkerController.js | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js index 6363fc9c..58478d28 100644 --- a/web/app/view/StateController.js +++ b/web/app/view/StateController.js @@ -33,6 +33,7 @@ Ext.define('Traccar.view.StateController', { '*': { selectdevice: 'selectDevice', selectreport: 'selectReport', + selectevent: 'selectEvent', deselectfeature: 'deselectFeature' } }, @@ -175,6 +176,14 @@ Ext.define('Traccar.view.StateController', { } }, + selectEvent: function (position) { + if (position instanceof Traccar.model.Position) { + this.deviceId = null; + this.position = position; + this.updatePosition(); + } + }, + deselectFeature: function () { this.deviceId = null; this.position = null; diff --git a/web/app/view/map/MapMarkerController.js b/web/app/view/map/MapMarkerController.js index 28f1226e..b7a1e296 100644 --- a/web/app/view/map/MapMarkerController.js +++ b/web/app/view/map/MapMarkerController.js @@ -501,7 +501,6 @@ Ext.define('Traccar.view.map.MapMarkerController', { selectEvent: function (position) { var marker; - this.fireEvent('deselectfeature'); if (position) { marker = this.addReportMarker(position); marker.set('event', true); -- cgit v1.2.3