diff --git a/README.md b/README.md index 48426e5..86acb34 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ It's an (un)fortunate coincidence that a Open/LibreOffice presentation tool is c VERSION HISTORY ----------------- + ### 0.5dev **CURRENTLY IN DEVELOPMENT** @@ -35,6 +36,17 @@ VERSION HISTORY - `past` class is added to already visited steps (when the step is left) +### 0.4.1 ([browse](http://github.com/bartaz/impress.js/tree/0.4.1), [zip](http://github.com/bartaz/impress.js/zipball/0.4.1), [tar](http://github.com/bartaz/impress.js/tarball/0.4.1)) + +#### BUGFIX RELEASE + +Changes is version 0.4 introduced a bug causing JavaScript errors being thrown all over the place in fallback mode. +This release fixes this issue. + +It also adds a flag `impress.supported` that can be used in JavaScript to check if impress.js is supported in the browser. + + + ### 0.4 ([browse](http://github.com/bartaz/impress.js/tree/0.4), [zip](http://github.com/bartaz/impress.js/zipball/0.4), [tar](http://github.com/bartaz/impress.js/tarball/0.4)) #### CHANGELOG diff --git a/js/impress.js b/js/impress.js index 232fe1b..2e3b928 100644 --- a/js/impress.js +++ b/js/impress.js @@ -140,7 +140,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"); @@ -170,7 +169,11 @@ }; var impress = window.impress = function ( rootId ) { - + + if (!impressSupported) { + return null; + } + rootId = rootId || "impress"; // if already initialized just return the API @@ -471,6 +474,9 @@ }); }; + + impress.supported = impressSupported; + })(document, window); // EVENTS @@ -480,6 +486,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) {