diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-10-26 01:41:16 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-10-26 01:41:16 +0200 |
| commit | 8dae6a5044f9c1b7a8497cc1c96155fd262b40cf (patch) | |
| tree | 6f546503efcb198a193f919efafb83977abb9535 /StoneIsland/platforms/ios/www/js | |
| parent | 531c60ee7ecbee516812d560b63a8317c3cf3590 (diff) | |
iphone x fixes
Diffstat (limited to 'StoneIsland/platforms/ios/www/js')
| -rwxr-xr-x | StoneIsland/platforms/ios/www/js/index.js | 4 | ||||
| -rwxr-xr-x | StoneIsland/platforms/ios/www/js/vendor/util.js | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/StoneIsland/platforms/ios/www/js/index.js b/StoneIsland/platforms/ios/www/js/index.js index 72358e0e..eb3b32b9 100755 --- a/StoneIsland/platforms/ios/www/js/index.js +++ b/StoneIsland/platforms/ios/www/js/index.js @@ -83,6 +83,10 @@ var app = (function(){ image.src = "./img/compass-logo.png" } + if (is_iphone_x) { + StatusBar.hide() + } + app.view = null app.router = new SiteRouter () diff --git a/StoneIsland/platforms/ios/www/js/vendor/util.js b/StoneIsland/platforms/ios/www/js/vendor/util.js index d45c4b98..27bdf008 100755 --- a/StoneIsland/platforms/ios/www/js/vendor/util.js +++ b/StoneIsland/platforms/ios/www/js/vendor/util.js @@ -174,6 +174,7 @@ var browser = (function( ua ) { var is_iphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) var is_ipad = (navigator.userAgent.match(/iPad/i)) var is_ios = is_iphone || is_ipad +var is_iphone_x = isIphoneX() var is_android = (navigator.userAgent.match(/Android/i)) var is_mobile = is_iphone || is_ipad || is_android var is_desktop = ! is_mobile; @@ -185,6 +186,14 @@ else { document.body.parentNode.classList.add("ios") } +function isIphoneX() { + return ( + is_iphone && + !is_ipad && + (window.innerHeight === 812 || window.innerWidth === 812) + ); +} + function selectElementContents(el) { if (window.getSelection && document.createRange) { var sel = window.getSelection(); |
