From a0a618d2cc0f5a6a8423d9eeb6fca54fcf8b41ff Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 3 Nov 2016 05:25:43 +1300 Subject: Simplify device size check --- web/app/controller/Root.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'web/app/controller') diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index d563340..81be05a 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -25,13 +25,6 @@ Ext.define('Traccar.controller.Root', { 'Traccar.model.Position' ], - 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 () { Ext.Ajax.request({ scope: this, @@ -89,7 +82,7 @@ Ext.define('Traccar.controller.Root', { if (attribution) { attribution.remove(); } - if (this.isPhone) { + if (window.matchMedia && window.matchMedia('(max-width: 768px)').matches) { Ext.create('widget.mainMobile'); } else { Ext.create('widget.main'); -- cgit v1.2.3