Better device width detection

This commit is contained in:
Mattias Erming 2014-05-31 09:40:44 -07:00
parent ab2a7b2aa3
commit 1cdae95a44
3 changed files with 1 additions and 10 deletions

View File

@ -383,9 +383,3 @@ button {
display: none;
}
}
@media screen and (max-device-width: 768px) {
#detect {
display: none;
}
}

View File

@ -13,8 +13,6 @@
</head>
<body>
<div id="detect"></div>
<div id="wrap">
<div id="viewport">
<aside id="sidebar">

View File

@ -113,7 +113,7 @@ $(function() {
}
var viewport = $("#viewport");
var touchDevice = ($("#detect").css("display") == "none");
var touchDevice = (window.screen.width <= 768);
var z = 1;
sidebar.on("click", "a", function(e) {
@ -220,7 +220,6 @@ $(function() {
});
});
// Toggle sidebars
var toggle = "click";
if (touchDevice) {
toggle = "touchstart";