aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-03 05:25:43 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-03 05:25:43 +1300
commita0a618d2cc0f5a6a8423d9eeb6fca54fcf8b41ff (patch)
tree49a792dceb63818fc70b475ea13dd1f1ca91e443
parent3237c77de0acb66d8910f3ea6863d74ad6594266 (diff)
downloadtrackermap-web-a0a618d2cc0f5a6a8423d9eeb6fca54fcf8b41ff.tar.gz
trackermap-web-a0a618d2cc0f5a6a8423d9eeb6fca54fcf8b41ff.tar.bz2
trackermap-web-a0a618d2cc0f5a6a8423d9eeb6fca54fcf8b41ff.zip
Simplify device size check
-rw-r--r--web/app.css13
-rw-r--r--web/app/controller/Root.js9
2 files changed, 1 insertions, 21 deletions
diff --git a/web/app.css b/web/app.css
index 95417606..6a7ea9ee 100644
--- a/web/app.css
+++ b/web/app.css
@@ -12,19 +12,6 @@
display: none !important;
}
-.state-indicator {
- position: absolute;
- top: -999em;
- left: -999em;
- z-index: 0;
-}
-
-@media all and (max-device-width: 768px) {
- .state-indicator {
- z-index: 1;
- }
-}
-
#attribution {
position: absolute;
bottom: 10px;
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index d5633404..81be05a5 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');