fix issue in browsers that don't support classList
authorHakim El Hattab <hakim.elhattab@gmail.com>
Thu, 18 Oct 2012 03:01:41 +0000 (23:01 -0400)
committerHakim El Hattab <hakim.elhattab@gmail.com>
Thu, 18 Oct 2012 03:01:41 +0000 (23:01 -0400)
js/reveal.js
js/reveal.min.js

index e53195f6a0fa1d9465598ef4c74bdee2af29560b..c2769e5fff69a876be9457fab659869310ddcb2d 100644 (file)
@@ -120,9 +120,6 @@ var Reveal = (function(){
                // Copy options over to our config object
                extend( config, options );
 
-               // Make sure we've got all the DOM elements we need
-               setupDOM();
-
                // Hide the address bar in mobile browsers
                hideAddressBar();
 
@@ -256,6 +253,9 @@ var Reveal = (function(){
         * to the current URL deeplink if there is one.
         */
        function start() {
+               // Make sure we've got all the DOM elements we need
+               setupDOM();
+               
                // Subscribe to input
                addEventListeners();
 
index e844a757a7c2799631d822ccc052b7daffa7a549..73053d3b528ae0664b507bde713df23fda469b2f 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
  */
 var Reveal=(function(){var l=".reveal .slides>section",b=".reveal .slides>section.present>section",R={controls:true,progress:true,history:false,keyboard:true,overview:true,loop:false,autoSlide:0,mouseWheel:true,rollingLinks:true,theme:null,transition:"default",dependencies:[]},Y=R.autoSlide,m=0,e=0,y,G,aj=[],f={},T="WebkitPerspective" in document.body.style||"MozPerspective" in document.body.style||"msPerspective" in document.body.style||"OPerspective" in document.body.style||"perspective" in document.body.style,n="WebkitTransform" in document.body.style||"MozTransform" in document.body.style||"msTransform" in document.body.style||"OTransform" in document.body.style||"transform" in document.body.style,z=0,k=0,D=0,ac={startX:0,startY:0,startSpan:0,startCount:0,handled:false,threshold:80};
-function i(ak){if((!n&&!T)){document.body.setAttribute("class","no-transforms");return;}t(R,ak);P();d();V();}function P(){f.theme=document.querySelector("#theme");
+function i(ak){if((!n&&!T)){document.body.setAttribute("class","no-transforms");return;}t(R,ak);d();V();}function P(){f.theme=document.querySelector("#theme");
 f.wrapper=document.querySelector(".reveal");if(!f.wrapper.querySelector(".progress")&&R.progress){var an=document.createElement("div");an.classList.add("progress");
 an.innerHTML="<span></span>";f.wrapper.appendChild(an);}if(!f.wrapper.querySelector(".controls")&&R.controls){var am=document.createElement("aside");am.classList.add("controls");
 am.innerHTML='<a class="left" href="#">&#x25C4;</a><a class="right" href="#">&#x25BA;</a><a class="up" href="#">&#x25B2;</a><a class="down" href="#">&#x25BC;</a>';
@@ -18,7 +18,7 @@ f.controlsDown=document.querySelector(".reveal .controls .down");}}function d(){
 document.body.style.height="120%";window.addEventListener("load",ad,false);window.addEventListener("orientationchange",ad,false);}}function V(){var al=[],ap=[];
 for(var am=0,ak=R.dependencies.length;am<ak;am++){var an=R.dependencies[am];if(!an.condition||an.condition()){if(an.async){ap.push(an.src);}else{al.push(an.src);
 }if(typeof an.callback==="function"){head.ready(an.src.match(/([\w\d_\-]*)\.?[^\\\/]*$/i)[0],an.callback);}}}function ao(){head.js.apply(null,ap);H();}if(al.length){head.ready(ao);
-head.js.apply(null,al);}else{ao();}}function H(){E();K();J();O();r("ready",{indexh:m,indexv:e,currentSlide:G});}function K(){if(T===false){R.transition="linear";
+head.js.apply(null,al);}else{ao();}}function H(){P();E();K();J();O();r("ready",{indexh:m,indexv:e,currentSlide:G});}function K(){if(T===false){R.transition="linear";
 }if(R.controls&&f.controls){f.controls.style.display="block";}if(R.progress&&f.progress){f.progress.style.display="block";}if(R.transition!=="default"){f.wrapper.classList.add(R.transition);
 }if(R.mouseWheel){document.addEventListener("DOMMouseScroll",o,false);document.addEventListener("mousewheel",o,false);}if(R.rollingLinks){N();}if(R.theme&&f.theme){var am=f.theme.getAttribute("href");
 var ak=/[^\/]*?(?=\.css)/;var al=am.match(ak)[0];if(R.theme!==al){am=am.replace(ak,R.theme);f.theme.setAttribute("href",am);}}}function E(){document.addEventListener("touchstart",A,false);