diff options
author | Abyss777 <abyss@fox5.ru> | 2017-08-09 12:10:23 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-08-09 12:10:23 +0500 |
commit | e7aaac6c970520728bbc0d431498ffac9bb98ad7 (patch) | |
tree | 5c775834a432ac7923bc4c8e76035a733086cbc5 | |
parent | 36ac724810ff77ec4070ed8f20ba7336204e384c (diff) | |
download | etbsa-traccar-web-e7aaac6c970520728bbc0d431498ffac9bb98ad7.tar.gz etbsa-traccar-web-e7aaac6c970520728bbc0d431498ffac9bb98ad7.tar.bz2 etbsa-traccar-web-e7aaac6c970520728bbc0d431498ffac9bb98ad7.zip |
Move hide logic to Main and rename attribute
-rw-r--r-- | web/app/controller/Root.js | 12 | ||||
-rw-r--r-- | web/app/store/ServerAttributes.js | 4 | ||||
-rw-r--r-- | web/app/store/UserAttributes.js | 4 | ||||
-rw-r--r-- | web/app/view/Main.js | 13 | ||||
-rw-r--r-- | web/app/view/map/MapController.js | 2 | ||||
-rw-r--r-- | web/l10n/en.json | 2 |
6 files changed, 21 insertions, 16 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index 5b0c881..d85102a 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -103,7 +103,7 @@ Ext.define('Traccar.controller.Root', { }, loadApp: function () { - var attribution, eventId, main, i; + var attribution, eventId; Ext.getStore('Groups').load(); Ext.getStore('Drivers').load(); Ext.getStore('Geofences').load(); @@ -124,15 +124,7 @@ Ext.define('Traccar.controller.Root', { if (Traccar.app.isMobile()) { Ext.create('widget.mainMobile'); } else { - main = Ext.create('widget.main'); - if (Traccar.app.getAttributePreference('web.disableReport', false).toString() === 'true') { - for (i = 0; i < main.items.length; i++) { - if (main.items.items[i].isXType('reportView')) { - main.items.items[i].hide(); - break; - } - } - } + Ext.create('widget.main'); } eventId = Ext.Object.fromQueryString(window.location.search).eventId; if (eventId) { diff --git a/web/app/store/ServerAttributes.js b/web/app/store/ServerAttributes.js index 7d72083..89a0137 100644 --- a/web/app/store/ServerAttributes.js +++ b/web/app/store/ServerAttributes.js @@ -48,8 +48,8 @@ Ext.define('Traccar.store.ServerAttributes', { minValue: Traccar.Style.mapDefaultZoom, maxValue: Traccar.Style.mapMaxZoom }, { - key: 'web.disableReport', - name: Strings.attributeWebDisableReport, + key: 'ui.disableReport', + name: Strings.attributeUiDisableReport, valueType: 'boolean' }] }); diff --git a/web/app/store/UserAttributes.js b/web/app/store/UserAttributes.js index 928a9be..6cf06fb 100644 --- a/web/app/store/UserAttributes.js +++ b/web/app/store/UserAttributes.js @@ -80,8 +80,8 @@ Ext.define('Traccar.store.UserAttributes', { minValue: Traccar.Style.mapDefaultZoom, maxValue: Traccar.Style.mapMaxZoom }, { - key: 'web.disableReport', - name: Strings.attributeWebDisableReport, + key: 'ui.disableReport', + name: Strings.attributeUiDisableReport, valueType: 'boolean' }] }); diff --git a/web/app/view/Main.js b/web/app/view/Main.js index 3f7cf7c..f656778 100644 --- a/web/app/view/Main.js +++ b/web/app/view/Main.js @@ -27,6 +27,19 @@ Ext.define('Traccar.view.Main', { 'Traccar.view.map.Map' ], + initComponent: function () { + var i; + if (Traccar.app.getAttributePreference('ui.disableReport', false).toString() === 'true') { + for (i = 0; i < this.items.length; i++) { + if (this.items[i].xtype === 'reportView') { + this.items[i].hidden = true; + break; + } + } + } + this.callParent(arguments); + }, + layout: 'border', defaults: { diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js index 39cf510..f2a561a 100644 --- a/web/app/view/map/MapController.js +++ b/web/app/view/map/MapController.js @@ -45,7 +45,7 @@ Ext.define('Traccar.view.map.MapController', { init: function () { this.callParent(); this.lookupReference('showReportsButton').setVisible(Traccar.app.isMobile() && - !Traccar.app.getAttributePreference('web.disableReport', false)); + !Traccar.app.getAttributePreference('ui.disableReport', false)); this.lookupReference('showEventsButton').setVisible(Traccar.app.isMobile()); }, diff --git a/web/l10n/en.json b/web/l10n/en.json index 0523935..6476b0d 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -88,7 +88,7 @@ "attributeMailSmtpAuth": "Mail: SMTP Auth Enable", "attributeMailSmtpUsername": "Mail: SMTP Username", "attributeMailSmtpPassword": "Mail: SMTP Password", - "attributeWebDisableReport": "Web: Disable Report", + "attributeUiDisableReport": "UI: Disable Report", "errorTitle": "Error", "errorGeneral": "Invalid parameters or constraints violation", "errorConnection": "Connection error", |