From c7d5365f81552cae16bbb91696ca3e67b4a0a2e9 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sun, 15 May 2011 18:33:00 -0400 Subject: major refactoring, improved file watching, changed site to public to support rack via pow (http://pow.cx) also implemented the basics of a 320 and up design refresh on the classic theme. This should make it great for mobile reading --- .../javascripts/libs/ios-viewport-scaling-bug-fix.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 public/javascripts/libs/ios-viewport-scaling-bug-fix.js (limited to 'public/javascripts/libs/ios-viewport-scaling-bug-fix.js') diff --git a/public/javascripts/libs/ios-viewport-scaling-bug-fix.js b/public/javascripts/libs/ios-viewport-scaling-bug-fix.js new file mode 100644 index 00000000..49f0d443 --- /dev/null +++ b/public/javascripts/libs/ios-viewport-scaling-bug-fix.js @@ -0,0 +1,20 @@ +// https://gist.github.com/901295 +// By @mathias, @cheeaun and @jdalton + +(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, true); + } + if ((meta = meta[meta.length - 1]) && addEvent in doc) { + fix(); + scales = [.25, 1.6]; + doc[addEvent](type, fix, true); + } +}(document)); + -- cgit v1.2.1