mirror of
https://github.com/yggdrasil-network/water.git
synced 2025-05-20 00:45:09 +03:00
Create gh-pages branch via GitHub
This commit is contained in:
commit
7f168c0d95
7 changed files with 646 additions and 0 deletions
20
javascripts/scale.fix.js
Normal file
20
javascripts/scale.fix.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
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);
|
||||
}
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue