diff options
author | luxagraf <sng@luxagraf.net> | 2011-05-10 11:43:43 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2011-05-10 11:43:43 -0500 |
commit | 45c093aee242da9440140638e8851f4687f72f3a (patch) | |
tree | 92cb86072640cdeaa1c9f8fd089242d68dbc63c2 /media/js/ios-viewport-scaling-bug-fix.js | |
parent | 65155fe56f0a95d697526e3f0823d4dd2858483e (diff) |
file cleanup
Diffstat (limited to 'media/js/ios-viewport-scaling-bug-fix.js')
-rw-r--r-- | media/js/ios-viewport-scaling-bug-fix.js | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/media/js/ios-viewport-scaling-bug-fix.js b/media/js/ios-viewport-scaling-bug-fix.js index 4e9a9b3..a33774c 100644 --- a/media/js/ios-viewport-scaling-bug-fix.js +++ b/media/js/ios-viewport-scaling-bug-fix.js @@ -1,23 +1,2 @@ -// My rewritten version -// 1) won't restrict viewport if JS is disabled -// 2) uses capture phase -// 3) assumes last viewport meta is the one to edit (incase for some odd reason there is more than one) -// 4) feature inference (no sniffs, behavior should be ignored on other enviros) -// 5) removes event handler after fired -!function(doc) { - var addEvent = 'addEventListener', - type = 'gesturestart', - qsa = 'querySelectorAll', - scales = [1, 1], - meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; - - function fix() { - meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; - doc.removeEventListener(type, fix, !0); - } - if ((meta = meta[meta.length - 1]) && addEvent in doc) { - fix(); - scales = [.25, 1.6]; - doc[addEvent](type, fix, !0); - } -}(document);
\ No newline at end of file +!function(doc){var addEvent='addEventListener',type='gesturestart',qsa='querySelectorAll',scales=[1,1],meta=qsa in doc?doc[qsa]('meta[name=viewport]'):[];function fix(){meta.content='width=device-width,minimum-scale='+scales[0]+',maximum-scale='+scales[1];doc.removeEventListener(type,fix,!0);} +if((meta=meta[meta.length-1])&&addEvent in doc){fix();scales=[.25,1.6];doc[addEvent](type,fix,!0);}}(document);
\ No newline at end of file |