Skip to content

Instantly share code, notes, and snippets.

@WebReflection
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WebReflection/8775076 to your computer and use it in GitHub Desktop.
Save WebReflection/8775076 to your computer and use it in GitHub Desktop.
a better version of github pages file included in all templates since it's currently leaking variables and creating a disturbing function declaration for all browsers.
if (/iP(?:od|hone)/.test(navigator.userAgent)) {
// deletable at least, i.e.
// if (window.gestureStart && dontWantIt) {
// document.removeEventListener("gesturestart", gestureStart);
// delete window.gestureStart;
// }
this.gestureStart = (function(metas, i){
function gestureStart() {
// address .length once per loop
for (i = metas.length; i--;) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
}
}
}
// address .length once per loop
for (i = metas.length; i--;) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
// I might argue it should be on capture phase here
document.addEventListener("gesturestart", gestureStart);
// to be able to address it out there
return gestureStart;
}(document.getElementsByTagName('meta')));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment