aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorEvgeny S Maksimov <admin@vragam.net>2019-02-26 12:21:51 +0300
committerEvgeny S Maksimov <admin@vragam.net>2019-02-26 12:21:51 +0300
commitaf41d034854a8d267463759a72fe1f610c9d297d (patch)
treea102b1dd99936c161fa01673fee09bb56c71cd8d /web
parent9a14f9599659c587a646ee322db5b65fa65d801d (diff)
downloadetbsa-traccar-web-af41d034854a8d267463759a72fe1f610c9d297d.tar.gz
etbsa-traccar-web-af41d034854a8d267463759a72fe1f610c9d297d.tar.bz2
etbsa-traccar-web-af41d034854a8d267463759a72fe1f610c9d297d.zip
Implementation fixes
Diffstat (limited to 'web')
-rw-r--r--web/app/view/EventsController.js15
-rw-r--r--web/app/view/ReportController.js21
-rw-r--r--web/app/view/StateController.js14
-rw-r--r--web/app/view/edit/DevicesController.js7
-rw-r--r--web/app/view/map/MapMarkerController.js5
5 files changed, 33 insertions, 29 deletions
diff --git a/web/app/view/EventsController.js b/web/app/view/EventsController.js
index 8eb4363..9bce2bf 100644
--- a/web/app/view/EventsController.js
+++ b/web/app/view/EventsController.js
@@ -24,7 +24,11 @@ Ext.define('Traccar.view.EventsController', {
listen: {
controller: {
'*': {
- deselectevent: 'deselectEvent'
+ selectdevice: 'deselectEvent',
+ selectreport: 'deselectEvent',
+ },
+ 'map': {
+ deselectfeature: 'deselectFeature'
}
},
store: {
@@ -79,7 +83,14 @@ Ext.define('Traccar.view.EventsController', {
Traccar.app.showEvents(false);
},
- deselectEvent: function () {
+
+ deselectEvent: function (object) {
+ if (object !== undefined) {
+ this.deselectFeature();
+ }
+ },
+
+ deselectFeature: function () {
this.getView().getSelectionModel().deselectAll();
},
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js
index 5d43007..2ffca96 100644
--- a/web/app/view/ReportController.js
+++ b/web/app/view/ReportController.js
@@ -32,12 +32,13 @@ Ext.define('Traccar.view.ReportController', {
listen: {
controller: {
'*': {
- selectdevice: 'selectDevice',
- showsingleevent: 'showSingleEvent',
- deselectfeature: 'deselectFeature'
+ selectdevice: 'deselectReport',
+ selectevent: 'deselectReport',
+ showsingleevent: 'showSingleEvent'
},
'map': {
- selectreport: 'selectReport'
+ selectreport: 'selectReport',
+ deselectfeature: 'deselectFeature'
}
},
global: {
@@ -231,12 +232,6 @@ Ext.define('Traccar.view.ReportController', {
}
},
- selectDevice: function (device) {
- if (device) {
- this.getGrid().getSelectionModel().deselectAll();
- }
- },
-
selectReport: function (object) {
var positionRelated, reportType = this.lookupReference('reportTypeField').getValue();
if (object instanceof Traccar.model.Position) {
@@ -251,6 +246,12 @@ Ext.define('Traccar.view.ReportController', {
}
},
+ deselectReport: function (object) {
+ if (object !== undefined) {
+ this.deselectFeature();
+ }
+ },
+
deselectFeature: function () {
if (this.lookupReference('reportTypeField').getValue() !== 'trips') {
this.getGrid().getSelectionModel().deselectAll();
diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js
index 58478d2..1ab1aa2 100644
--- a/web/app/view/StateController.js
+++ b/web/app/view/StateController.js
@@ -32,8 +32,8 @@ Ext.define('Traccar.view.StateController', {
controller: {
'*': {
selectdevice: 'selectDevice',
- selectreport: 'selectReport',
- selectevent: 'selectEvent',
+ selectreport: 'selectPosition',
+ selectevent: 'selectPosition',
deselectfeature: 'deselectFeature'
}
},
@@ -168,15 +168,7 @@ Ext.define('Traccar.view.StateController', {
}
},
- selectReport: function (position) {
- if (position instanceof Traccar.model.Position) {
- this.deviceId = null;
- this.position = position;
- this.updatePosition();
- }
- },
-
- selectEvent: function (position) {
+ selectPosition: function (position) {
if (position instanceof Traccar.model.Position) {
this.deviceId = null;
this.position = position;
diff --git a/web/app/view/edit/DevicesController.js b/web/app/view/edit/DevicesController.js
index 120944b..79cbe2f 100644
--- a/web/app/view/edit/DevicesController.js
+++ b/web/app/view/edit/DevicesController.js
@@ -35,7 +35,8 @@ Ext.define('Traccar.view.edit.DevicesController', {
listen: {
controller: {
'*': {
- selectreport: 'selectReport'
+ selectreport: 'deselectDevice',
+ selectevent: 'deselectDevice'
},
'root': {
selectdevice: 'selectDevice'
@@ -122,8 +123,8 @@ Ext.define('Traccar.view.edit.DevicesController', {
this.getView().getView().focusRow(device);
},
- selectReport: function (position) {
- if (position !== undefined) {
+ deselectDevice: function (object) {
+ if (object !== undefined) {
this.deselectFeature();
}
},
diff --git a/web/app/view/map/MapMarkerController.js b/web/app/view/map/MapMarkerController.js
index b7a1e29..295d2f5 100644
--- a/web/app/view/map/MapMarkerController.js
+++ b/web/app/view/map/MapMarkerController.js
@@ -457,9 +457,6 @@ Ext.define('Traccar.view.map.MapMarkerController', {
if (this.selectedMarker) {
if (this.selectedMarker.get('event')) {
this.getView().getMarkersSource().removeFeature(this.selectedMarker);
- if (!marker || !marker.get('event')) {
- this.fireEvent('deselectevent');
- }
} else if (!Ext.getStore('ReportRoute').showMarkers &&
this.selectedMarker.get('record') instanceof Traccar.model.Position) {
this.getView().getMarkersSource().removeFeature(this.selectedMarker);
@@ -496,6 +493,8 @@ Ext.define('Traccar.view.map.MapMarkerController', {
this.reportMarkers[position.get('id')] = this.addReportMarker(position);
}
this.selectMarker(this.reportMarkers[position.get('id')], center);
+ } else if (this.selectedMarker) {
+ this.selectMarker(null, false);
}
},