diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/app/view/EventsController.js | 6 | ||||
-rw-r--r-- | web/app/view/map/MapMarkerController.js | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/web/app/view/EventsController.js b/web/app/view/EventsController.js index 16b3c779..d275c2c2 100644 --- a/web/app/view/EventsController.js +++ b/web/app/view/EventsController.js @@ -88,9 +88,9 @@ Ext.define('Traccar.view.EventsController', { event = selected.length > 0 ? selected[0] : null; if (event && event.get('positionId')) { position = Ext.getStore('EventPositions').getById(event.get('positionId')); - if (position) { - this.fireEvent('selectevent', position); - } + this.fireEvent('selectevent', position); + } else { + this.fireEvent('selectevent'); } this.lookupReference('removeEventButton').setDisabled(!event); } diff --git a/web/app/view/map/MapMarkerController.js b/web/app/view/map/MapMarkerController.js index 5d41932e..aa5be0f7 100644 --- a/web/app/view/map/MapMarkerController.js +++ b/web/app/view/map/MapMarkerController.js @@ -495,9 +495,13 @@ Ext.define('Traccar.view.map.MapMarkerController', { }, selectEvent: function (position) { - var maker = this.addReportMarker(position); - maker.set('event', true); - this.selectMarker(maker, true); + if (position) { + var maker = this.addReportMarker(position); + maker.set('event', true); + this.selectMarker(maker, true); + } else if (this.selectedMarker && this.selectedMarker.get('event')) { + this.selectMarker(null, false); + } }, selectFeature: function (feature) { |