aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartek Szopka <bartek.szopka+github@gmail.com>2012-03-11 09:10:36 +0000
committerBartek Szopka <bartek.szopka+github@gmail.com>2012-03-11 09:10:36 +0000
commit78f2ce657c9e04182cee8ad0db23b5f92dabc2c6 (patch)
treeb49fae681624e562abd3704c98e2fa1a5e7ac9e1
parentadb2fc498b6efa107e8b9473e065171135a446c6 (diff)
downloadimpress.js-78f2ce657c9e04182cee8ad0db23b5f92dabc2c6.tar.gz
"fallback mode fix"
-rw-r--r--js/impress.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/js/impress.js b/js/impress.js
index 53b6b73..5896167 100644
--- a/js/impress.js
+++ b/js/impress.js
@@ -124,7 +124,6 @@
if (!impressSupported) {
// we can't be sure that `classList` is supported
body.className += " impress-not-supported ";
- return;
} else {
body.classList.remove("impress-not-supported");
body.classList.add("impress-supported");
@@ -144,7 +143,11 @@
};
var impress = window.impress = function ( rootId ) {
-
+
+ if (!impressSupported) {
+ return null;
+ }
+
rootId = rootId || "impress";
// if already initialized just return the API
@@ -399,6 +402,9 @@
});
};
+
+ impress.supported = impressSupported;
+
})(document, window);
// EVENTS
@@ -408,6 +414,11 @@
var impress = window.impress;
+ // if impress is not supported don't add any handlers
+ if (!impress.supported) {
+ return;
+ }
+
// throttling function calls, by Remy Sharp
// http://remysharp.com/2010/07/21/throttling-function-calls/
var throttle = function (fn, delay) {