aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller/Root.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-03-18 20:43:00 +1300
committerGitHub <noreply@github.com>2017-03-18 20:43:00 +1300
commit12fce5557a054dcbd2b63c3952d0e111e1c7fe02 (patch)
tree0b88aa56e842ba152a35158b6caabe982a2c9563 /web/app/controller/Root.js
parentfd2207b15d98d8fdef306f3b94924a759c80a3d9 (diff)
parent61590f09ba735a532ff337ea841c8f4d27bd81e3 (diff)
downloadtrackermap-web-12fce5557a054dcbd2b63c3952d0e111e1c7fe02.tar.gz
trackermap-web-12fce5557a054dcbd2b63c3952d0e111e1c7fe02.tar.bz2
trackermap-web-12fce5557a054dcbd2b63c3952d0e111e1c7fe02.zip
Merge pull request #442 from Abyss777/fix_stores_loads
Initialize stores on application load
Diffstat (limited to 'web/app/controller/Root.js')
-rw-r--r--web/app/controller/Root.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index b6e5f385..950b3348 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -78,7 +78,9 @@ Ext.define('Traccar.controller.Root', {
var attribution, eventId;
Ext.getStore('Groups').load();
Ext.getStore('Geofences').load();
+ Ext.getStore('Calendars').load();
Ext.getStore('AttributeAliases').load();
+ this.initReportEventTypesStore();
Ext.getStore('Devices').load({
scope: this,
callback: function () {
@@ -239,5 +241,25 @@ Ext.define('Traccar.controller.Root', {
if (lat === 0 && lon === 0 && zoom === 0) {
this.fireEvent('zoomtoalldevices');
}
+ },
+
+ initReportEventTypesStore: function () {
+ var store = Ext.getStore('ReportEventTypes');
+ store.add({
+ type: Traccar.store.ReportEventTypes.allEvents,
+ name: Strings.eventAll
+ });
+ Ext.create('Traccar.store.AllNotifications').load({
+ scope: this,
+ callback: function (records, operation, success) {
+ var i, value;
+ if (success) {
+ for (i = 0; i < records.length; i++) {
+ value = records[i].get('type');
+ store.add({type: value, name: Traccar.app.getEventString(value)});
+ }
+ }
+ }
+ });
}
});