iPad viewport now defined in script to avoid breaking mobile fallback mode

This commit is contained in:
Bartek Szopka
2012-02-15 23:56:03 +01:00
parent 59e1c483bc
commit a2f4337ec2
2 changed files with 11 additions and 1 deletions

View File

@@ -124,6 +124,16 @@
root.className = "";
}
// viewport updates for iPad
var meta = $("meta[name='viewport']") || document.createElement("meta");
// hardcoding these values looks pretty bad, as they kind of depend on the content
// so they should be at least configurable
meta.content = "width=1024, initial-scale=0.75, user-scalable=no";
if (meta.parentNode != document.head) {
meta.name = 'viewport';
document.head.appendChild(meta);
}
var canvas = document.createElement("div");
canvas.className = "canvas";