diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-03 21:01:45 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-03 21:01:45 +1300 |
commit | 48f981a2a9755fb0af6497020e499bb0883e0e1f (patch) | |
tree | ac960f950e4f37aec2614a97a706aed34a1fb2db /web/app/controller | |
parent | d16121684ecae7646aa87616a64d60978d087bc0 (diff) | |
download | traccar-server-48f981a2a9755fb0af6497020e499bb0883e0e1f.tar.gz traccar-server-48f981a2a9755fb0af6497020e499bb0883e0e1f.tar.bz2 traccar-server-48f981a2a9755fb0af6497020e499bb0883e0e1f.zip |
Enable JavaScript strict mode
Diffstat (limited to 'web/app/controller')
-rw-r--r-- | web/app/controller/Root.js | 114 |
1 files changed, 59 insertions, 55 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index aa2682708..3d2a82d48 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -13,64 +13,68 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.controller.Root', { - extend: 'Ext.app.Controller', - - requires: [ - 'Traccar.LoginManager', - 'Traccar.view.Login', - 'Traccar.view.Main', - 'Traccar.view.MainMobile' - ], + Ext.define('Traccar.controller.Root', { + extend: 'Ext.app.Controller', - init: function () { - var indicator = document.createElement('div'); - indicator.className = 'state-indicator'; - document.body.appendChild(indicator); - this.isPhone = parseInt(window.getComputedStyle(indicator).getPropertyValue('z-index'), 10) !== 0; - }, - - onLaunch: function () { - Traccar.LoginManager.server({ - scope: this, - callback: 'onServer' - }); - }, + requires: [ + 'Traccar.LoginManager', + 'Traccar.view.Login', + 'Traccar.view.Main', + 'Traccar.view.MainMobile' + ], - onServer: function () { - Traccar.LoginManager.session({ - scope: this, - callback: 'onSession' - }); - }, - - onSession: function (success) { - if (success) { - this.loadApp(); - } else { - this.login = Ext.create('widget.login', { - listeners: { - scope: this, - login: 'onLogin' - } + init: function () { + var indicator = document.createElement('div'); + indicator.className = 'state-indicator'; + document.body.appendChild(indicator); + this.isPhone = parseInt(window.getComputedStyle(indicator).getPropertyValue('z-index'), 10) !== 0; + }, + + onLaunch: function () { + Traccar.LoginManager.server({ + scope: this, + callback: 'onServer' }); - this.login.show(); - } - }, + }, + + onServer: function () { + Traccar.LoginManager.session({ + scope: this, + callback: 'onSession' + }); + }, - onLogin: function () { - this.login.close(); - this.loadApp(); - }, - - loadApp: function () { - Ext.getStore('Devices').load(); - Ext.getBody().empty(); - if (this.isPhone) { - Ext.create('widget.mainMobile'); - } else { - Ext.create('widget.main'); + onSession: function (success) { + if (success) { + this.loadApp(); + } else { + this.login = Ext.create('widget.login', { + listeners: { + scope: this, + login: 'onLogin' + } + }); + this.login.show(); + } + }, + + onLogin: function () { + this.login.close(); + this.loadApp(); + }, + + loadApp: function () { + Ext.getStore('Devices').load(); + Ext.getBody().empty(); + if (this.isPhone) { + Ext.create('widget.mainMobile'); + } else { + Ext.create('widget.main'); + } } - } -}); + }); + +})(); |