Last active
August 29, 2015 13:55
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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