From 78f2ce657c9e04182cee8ad0db23b5f92dabc2c6 Mon Sep 17 00:00:00 2001 From: Bartek Szopka Date: Sun, 11 Mar 2012 09:10:36 +0000 Subject: [PATCH] "fallback mode fix" --- js/impress.js | 15 +++++++++++++-- 1 file 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) {