2011-05-15 18:33:00 -04:00
|
|
|
// https://gist.github.com/901295
|
|
|
|
// By @mathias, @cheeaun and @jdalton
|
|
|
|
|
|
|
|
(function(doc) {
|
2011-05-30 00:30:16 -04:00
|
|
|
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);
|
|
|
|
}
|
2011-05-15 18:33:00 -04:00
|
|
|
}(document));
|
|
|
|
|