diff options
author | Abyss777 <abyss@fox5.ru> | 2016-12-01 17:30:50 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-12-01 17:30:50 +0500 |
commit | 42574b6700384bd8a45d3410c4f8da644dad112e (patch) | |
tree | 6ada5763c1aea05441b02efe82ff038517cd5897 /web/app/controller/Root.js | |
parent | 74072cf3ca6acf67d228287e446e3013277e7408 (diff) | |
download | trackermap-web-42574b6700384bd8a45d3410c4f8da644dad112e.tar.gz trackermap-web-42574b6700384bd8a45d3410c4f8da644dad112e.tar.bz2 trackermap-web-42574b6700384bd8a45d3410c4f8da644dad112e.zip |
Implement in other way
Diffstat (limited to 'web/app/controller/Root.js')
-rw-r--r-- | web/app/controller/Root.js | 13 |
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:'; |