From 5433c47155452951b8c75587725bf6c92f8ff11d Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 1 Dec 2016 17:45:19 +0500 Subject: Handle 'showsingleevent' only in one place --- web/app/view/ReportController.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/app/view/ReportController.js') diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js index e1a64e69..97407e23 100644 --- a/web/app/view/ReportController.js +++ b/web/app/view/ReportController.js @@ -210,9 +210,14 @@ Ext.define('Traccar.view.ReportController', { params: { id: positionIds }, + scope: this, callback: function (records, operation, success) { if (success) { Ext.getStore('ReportRoute').add(records); + if (this.singleEvent) { + this.singleEvent = false; + this.fireEvent('selectreport', records[0], false); + } } } }); @@ -220,6 +225,7 @@ Ext.define('Traccar.view.ReportController', { }, showSingleEvent: function (eventId) { + this.singleEvent = true; this.lookupReference('reportTypeField').setValue('events'); Ext.getStore('Events').load({ id: eventId, -- cgit v1.2.3