aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller/Root.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/controller/Root.js')
-rw-r--r--web/app/controller/Root.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index 5600d4e8..379a0d8a 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -75,7 +75,7 @@ Ext.define('Traccar.controller.Root', {
},
loadApp: function () {
- var attribution;
+ var attribution, eventId;
Ext.getStore('Groups').load();
Ext.getStore('Geofences').load();
Ext.getStore('AttributeAliases').load();
@@ -94,6 +94,11 @@ Ext.define('Traccar.controller.Root', {
} else {
Ext.create('widget.main');
}
+ eventId = Ext.Object.fromQueryString(window.location.search).eventId;
+ if (eventId) {
+ this.application.fireEvent('showSingleEvent', eventId);
+ //this.removeUrlParameter('eventId');
+ }
},
beep: function () {
@@ -108,6 +113,12 @@ Ext.define('Traccar.controller.Root', {
return muteButton && !muteButton.pressed;
},
+ removeUrlParameter: function (param) {
+ var params = Ext.Object.fromQueryString(window.location.search);
+ delete params[param];
+ window.history.pushState(null, null, window.location.pathname + '?' + Ext.Object.toQueryString(params));
+ },
+
asyncUpdate: function (first) {
var protocol, pathname, socket, self = this;
protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';