Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Reverted mobile device size checks, will revisit later

Mike McGann886b04b26ea0
diff --git a/test/util/wv.util.browser-test.js b/test/util/wv.util.browser-test.js
index 15c06ff4b..2534a4d4d 100644
--- a/test/util/wv.util.browser-test.js
+++ b/test/util/wv.util.browser-test.js
@@ -120,14 +120,6 @@ buster.testCase("wv.util.browser", {
buster.assert(wv.util.browser.tests.small());
},
- "Constrained device, width": function() {
- this.stub(window, "$").returns({
- width: this.stub().returns(600),
- height: this.stub().returns(1000)
- });
- buster.assert(wv.util.browser.tests.constrained());
- },
-
"Constrained device, height": function() {
this.stub(window, "$").returns({
width: this.stub().returns(1000),
diff --git a/web/css/wv.mobile.css b/web/css/wv.mobile.css
index 055a05a4a..492f30345 100644
--- a/web/css/wv.mobile.css
+++ b/web/css/wv.mobile.css
@@ -1,5 +1,4 @@
-/* @media only screen and (max-width: 720px) and (orientation: portrait), only screen and (max-height: 320px) and (orientation: landscape), only screen and (device-aspect-ratio: 2/3) and (orientation:portrait), only screen and (device-aspect-ratio:40/71) and (orientation:portrait){ */
-@media screen and (max-width: 720px), screen and (max-height: 720px) {
+@media only screen and (max-width: 720px) and (orientation: portrait), only screen and (max-height: 320px) and (orientation: landscape), only screen and (device-aspect-ratio: 2/3) and (orientation:portrait), only screen and (device-aspect-ratio:40/71) and (orientation:portrait){
.products {
display:block;
float:left;
diff --git a/web/js/date/wv.date.timeline.js b/web/js/date/wv.date.timeline.js
index 4a6b6feca..f2ff0ef39 100644
--- a/web/js/date/wv.date.timeline.js
+++ b/web/js/date/wv.date.timeline.js
@@ -269,10 +269,11 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
};
var resizeWindow = function() {
- if ( self.enabled && wv.util.browser.constrained) {
+ var small = wv.util.browser.small || wv.util.browser.constrained;
+ if ( self.enabled && small ) {
self.enabled = false;
$("#timeline").hide();
- } else if ( !self.enabled && !wv.util.browser.constrained ) {
+ } else if ( !self.enabled && !small ) {
self.enabled = true;
$("#timeline").show();
}
diff --git a/web/js/layers/wv.layers.sidebar.js b/web/js/layers/wv.layers.sidebar.js
index a6a7adc20..e62317a95 100644
--- a/web/js/layers/wv.layers.sidebar.js
+++ b/web/js/layers/wv.layers.sidebar.js
@@ -259,14 +259,11 @@ wv.layers.sidebar = wv.layers.sidebar || function(models, config) {
};
var resize = function() {
- console.log("check");
if ( !mobile && wv.util.browser.small ) {
- console.log("COLLAPSE");
self.collapseNow();
mobile = true;
} else if ( mobile && !wv.util.browser.small ) {
- console.log("EXPAND");
self.expandNow();
mobile = false;
}
diff --git a/web/js/util/wv.util.browser.js b/web/js/util/wv.util.browser.js
index 2c14d4918..4cf9e3a37 100644
--- a/web/js/util/wv.util.browser.js
+++ b/web/js/util/wv.util.browser.js
@@ -92,7 +92,9 @@ wv.util.browser = wv.util.browser || (function() {
self.localStorage = true;
self.history = true;
self.touchDevice = false;
- self.mobileSize = 720;
+
+ self.mobileWidth = 720;
+ self.constrainedHeight = 320;
var init = function() {
var tests = self.tests;
@@ -115,7 +117,6 @@ wv.util.browser = wv.util.browser || (function() {
var onResize = function() {
self.small = tests.small();
self.constrained = tests.constrained();
- console.log("small", wv.util.browser.small, "constrained", self.constrained, $(window).width(), $(window).height());
};
$(window).on("resize", onResize);
onResize();
@@ -198,11 +199,11 @@ wv.util.browser = wv.util.browser || (function() {
};
self.tests.small = function() {
- return $(window).width() < self.mobileSize || $(window).height() < self.mobileSize;
+ return $(window).width() < self.mobileWidth;
};
self.tests.constrained = function() {
- return $(window).width() < self.mobileSize || $(window).height() < self.mobileSize;
+ return $(window).height() < self.constrainedHeight;
};
self.tests.history = function() {