aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartek Szopka <bartek.szopka+github@gmail.com>2012-02-15 23:56:03 +0100
committerBartek Szopka <bartek.szopka+github@gmail.com>2012-02-15 23:56:03 +0100
commita2f4337ec2004116b46892482de0149608d1e773 (patch)
tree81ada7461c3e8ca22cb00bdf7d6d59cfc33ffd70
parent59e1c483bc76354b81a50efb946a527493655c5a (diff)
downloadimpress.js-a2f4337ec2004116b46892482de0149608d1e773.tar.gz
iPad viewport now defined in script to avoid breaking mobile fallback mode
-rw-r--r--index.html2
-rw-r--r--js/impress.js10
2 files changed, 11 insertions, 1 deletions
diff --git a/index.html b/index.html
index beb26d8..3fc937f 100644
--- a/index.html
+++ b/index.html
@@ -66,7 +66,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
- <meta name="viewport" content="width=1024, initial-scale=0.75, user-scalable=no" />
+ <meta name="viewport" content="width=1024" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>impress.js | presentation tool based on the power of CSS3 transforms and transitions in modern browsers | by Bartek Szopka @bartaz</title>
diff --git a/js/impress.js b/js/impress.js
index 8698363..e889a74 100644
--- a/js/impress.js
+++ b/js/impress.js
@@ -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";