forked from M-Labs/web2019
Fix #72 - make side-panel button depend on screen size, same as the appearance
Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
parent
52afd69445
commit
dee2a40151
|
@ -26,26 +26,12 @@
|
|||
<script>
|
||||
(function () {
|
||||
function deviceIsMobile() {
|
||||
// https://coderwall.com/p/i817wa/one-line-function-to-detect-mobile-devices-with-javascript
|
||||
return (
|
||||
(typeof window.orientation !== 'undefined') ||
|
||||
navigator.userAgent.match(/Android/i) ||
|
||||
navigator.userAgent.match(/webOS/i) ||
|
||||
navigator.userAgent.match(/iPhone/i) ||
|
||||
navigator.userAgent.match(/iPad/i) ||
|
||||
navigator.userAgent.match(/iPod/i) ||
|
||||
navigator.userAgent.match(/BlackBerry/i) ||
|
||||
navigator.userAgent.match(/Windows Phone/i) ||
|
||||
(navigator.userAgent.indexOf('IEMobile') !== -1)
|
||||
);
|
||||
};
|
||||
// Do not rely on User-Agent: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent
|
||||
// Be in sync with css/order-hardware.css
|
||||
return window.innerWidth < 768;
|
||||
}
|
||||
|
||||
window.deviceIsMobile = deviceIsMobile;
|
||||
|
||||
return;
|
||||
if (deviceIsMobile()) {
|
||||
alert('The online crate configuration tool is not available for mobile browsers yet. Please use a desktop computer or email us at sales@m-l****.hk to get a quote.');
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue