fix issue in browsers that don't support classList

This commit is contained in:
Hakim El Hattab 2012-10-17 23:01:41 -04:00
parent 3a2036e2b2
commit 551c783b72
2 changed files with 5 additions and 5 deletions

View 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();

4
js/reveal.min.js vendored
View 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);