]> git.xonotic.org Git - xonotic/gmqcc.git/blob - javascripts/scale.fix.js
update irc channel
[xonotic/gmqcc.git] / javascripts / scale.fix.js
1 fixScale = function(doc) {
2
3         var addEvent = 'addEventListener',
4             type = 'gesturestart',
5             qsa = 'querySelectorAll',
6             scales = [1, 1],
7             meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
8
9         function fix() {
10                 meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
11                 doc.removeEventListener(type, fix, true);
12         }
13
14         if ((meta = meta[meta.length - 1]) && addEvent in doc) {
15                 fix();
16                 scales = [.25, 1.6];
17                 doc[addEvent](type, fix, true);
18         }
19
20 };