aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/ReportController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-12-01 12:00:19 +0500
committerAbyss777 <abyss@fox5.ru>2016-12-01 12:00:19 +0500
commitb53b223a07dbba48321d42204ffbb07a33ac2caf (patch)
treea567dce2fcc0fe49ebcf26792fb92588a425da4f /web/app/view/ReportController.js
parent38b3a3e6df91b7c2135cfcca855826ce8f1b1e63 (diff)
downloadtrackermap-web-b53b223a07dbba48321d42204ffbb07a33ac2caf.tar.gz
trackermap-web-b53b223a07dbba48321d42204ffbb07a33ac2caf.tar.bz2
trackermap-web-b53b223a07dbba48321d42204ffbb07a33ac2caf.zip
- Handle eventId url parameter
- Fit map view to events positions markers
Diffstat (limited to 'web/app/view/ReportController.js')
-rw-r--r--web/app/view/ReportController.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js
index f8a01bc6..32a44df5 100644
--- a/web/app/view/ReportController.js
+++ b/web/app/view/ReportController.js
@@ -40,12 +40,32 @@ Ext.define('Traccar.view.ReportController', {
},
store: {
'#ReportEvents': {
+ add: 'loadEvents',
load: 'loadEvents'
}
}
}
},
+ init: function () {
+ var eventId = Ext.Object.fromQueryString(window.location.search).eventId;
+ if (eventId) {
+ this.lookupReference('reportTypeField').setValue('events');
+ Ext.getStore('Events').load({
+ params: {
+ id: eventId
+ },
+ callback: function (records, operation, success) {
+ if (success) {
+ Ext.getStore('ReportEvents').add(records);
+ }
+ }
+ });
+ Traccar.app.hasEventId = true;
+ Traccar.app.removeUrlParameter('eventId');
+ }
+ },
+
hideReports: function () {
Traccar.app.showReports(false);
},
@@ -214,6 +234,15 @@ Ext.define('Traccar.view.ReportController', {
}
}
});
+ } else if (Traccar.app.hasEventId && data.length > 0) {
+ this.getView().getSelectionModel().select([data[0]], false, true);
+ this.getView().getView().focusRow(data[0]);
+ if (Traccar.app.isMobile()) {
+ Traccar.app.showReports(true);
+ } else {
+ this.getView().expand();
+ }
+ Traccar.app.hasEventId = false;
}
},