Skip to content

Commit

Permalink
Moved page width resize detection to using Resize Events rather than …
Browse files Browse the repository at this point in the history
…onresize.
  • Loading branch information
Paul Jackson authored and Paul Jackson committed Aug 28, 2012
1 parent 61986c9 commit 2d38bef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/js/pe-ap-min.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/js/pe-ap.js
Expand Up @@ -1381,11 +1381,13 @@
}

// TODO: find a better way to switch back and forth between mobile and desktop modes.
window.onresize = function () {
if (pe.mobile !== pe.mobilecheck()) {
pe.resize(function () {
var mobilecheck = pe.mobilecheck();
if (pe.mobile !== mobilecheck) {
pe.mobile = mobilecheck;
window.location.href = decodeURI(pe.url(window.location.href).removehash());
}
};
});
});

// Load the polyfills with dependencies
Expand Down

0 comments on commit 2d38bef

Please sign in to comment.