1
0
mirror of https://github.com/Chouchen/ShikiryuRSS.git synced 2024-05-15 17:11:30 +02:00
ShikiryuRSS/javascripts/scale.fix.js
2013-05-22 07:43:16 -07:00

20 lines
503 B
JavaScript

fixScale = 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);
}
};