From 8d1610ee11ce895f4377a67dbcbe69475bfed830 Mon Sep 17 00:00:00 2001 From: Ashley Sands Date: Mon, 24 Nov 2014 11:50:44 +1000 Subject: [PATCH] Fixed a bug where iOS retina devices were not supported by the splitview code. Also added a console error if the device is not supported. --- src/jquery.mobile.splitview.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jquery.mobile.splitview.js b/src/jquery.mobile.splitview.js index 62dae21..5fa71fa 100644 --- a/src/jquery.mobile.splitview.js +++ b/src/jquery.mobile.splitview.js @@ -8,7 +8,8 @@ if($.support.touch){ $('html').addClass('touch'); } - var $query = $.mobile.media('screen and (min-width: 480px)') && ($.mobile.media('(-webkit-max-device-pixel-ratio: 1.2)') || $.mobile.media('(max--moz-device-pixel-ratio: 1.2)')); + var isRetinaDevice = $.mobile.media('(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)'); + var $query = $.mobile.media('screen and (min-width: 480px)') && ($.mobile.media('(-webkit-max-device-pixel-ratio: 1.2)') || $.mobile.media('(max--moz-device-pixel-ratio: 1.2)') || isRetinaDevice); $.support.splitview = ($query || ($.mobile.browser.ie && $(this).width() >= 480)) && $.mobile.ajaxEnabled; if ($.support.splitview) { $('html').addClass('splitview'); @@ -682,6 +683,9 @@ $this.replaceWith($this.html()); }) }); + if (window.console) { + console.error("This device is not support by jquerymobile-splitview"); + } } }); })(jQuery,window);