aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorEvgeny S Maksimov <admin@vragam.net>2019-02-25 20:46:48 +0300
committerEvgeny S Maksimov <admin@vragam.net>2019-02-25 20:46:48 +0300
commit9a14f9599659c587a646ee322db5b65fa65d801d (patch)
tree9ca5617b48ec4f134ab0bdffc2bdc9dab88b4a6a /web
parent05b555c6c8539f35c1caf3b1f4e252146f1e7d38 (diff)
downloadetbsa-traccar-web-9a14f9599659c587a646ee322db5b65fa65d801d.tar.gz
etbsa-traccar-web-9a14f9599659c587a646ee322db5b65fa65d801d.tar.bz2
etbsa-traccar-web-9a14f9599659c587a646ee322db5b65fa65d801d.zip
Add connection between event and its state
Diffstat (limited to 'web')
-rw-r--r--web/app/view/StateController.js9
-rw-r--r--web/app/view/map/MapMarkerController.js1
2 files changed, 9 insertions, 1 deletions
diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js
index 6363fc9..58478d2 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 28f1226..b7a1e29 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);