|
|
@ -1,5 +1,16 @@ |
|
|
|
(function() { |
|
|
|
|
|
|
|
// Add ios class to body on iOS devices
|
|
|
|
function iosBodyClass() { |
|
|
|
if( |
|
|
|
/iPad|iPhone|iPod/.test(navigator.userAgent) |
|
|
|
&& !window.MSStream |
|
|
|
&& document.body.classList |
|
|
|
) { |
|
|
|
document.body.classList.add('ios'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Check if DOM has already loaded as we're loading async
|
|
|
|
['interactive', 'complete'].indexOf(document.readyState) >= 0 |
|
|
|
? init() |
|
|
@ -9,13 +20,7 @@ |
|
|
|
function init() { |
|
|
|
|
|
|
|
// Check for iOS
|
|
|
|
if( |
|
|
|
/iPad|iPhone|iPod/.test(navigator.userAgent) |
|
|
|
&& !window.MSStream |
|
|
|
&& document.body.classList |
|
|
|
) { |
|
|
|
document.body.classList.add('ios'); |
|
|
|
} |
|
|
|
iosBodyClass(); |
|
|
|
} |
|
|
|
|
|
|
|
})(); |
|
|
|