Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

prevent same theme from loading repeatedly

  • Loading branch information...
commit 0c06469d82fbc0ca2f4a2bf2d07e9e5a04cfc37f 1 parent dc9b93a
@hakimel hakimel authored
Showing with 12 additions and 7 deletions.
  1. +5 −1 js/reveal.js
  2. +7 −6 js/reveal.min.js
View
6 js/reveal.js
@@ -226,8 +226,12 @@ var Reveal = (function(){
dom.progress.style.display = 'block';
}
+ // Load the theme in the config, if it's not already loaded
if( config.theme && dom.theme ) {
- dom.theme.setAttribute( 'href', 'css/theme/' + config.theme + '.css' );
+ var themeURL = 'css/theme/' + config.theme + '.css';
+ if( dom.theme.getAttribute( 'href' ) !== themeURL ) {
+ dom.theme.setAttribute( 'href', themeURL );
+ }
}
if( config.transition !== 'default' ) {
View
13 js/reveal.min.js
@@ -14,12 +14,13 @@ document.body.style.height="120%";window.addEventListener("load",X,false);window
for(var af=0,ad=N.dependencies.length;af<ad;af++){var ag=N.dependencies[af];if(!ag.condition||ag.condition()){if(ag.async){ai.push(ag.src);}else{ae.push(ag.src);
}if(typeof ag.callback==="function"){head.ready(ag.src.match(/([\w\d_-]*)\.?[^\\\/]*$/i)[0],ag.callback);}}}function ah(){head.js.apply(null,ai);F();}if(ae.length){head.ready(ah);
head.js.apply(null,ae);}else{ah();}}function F(){C();I();H();K();}function I(){if(P===false){N.transition="linear";}if(N.controls&&d.controls){d.controls.style.display="block";
-}if(N.progress&&d.progress){d.progress.style.display="block";}if(N.theme&&d.theme){d.theme.setAttribute("href","css/theme/"+N.theme+".css");}if(N.transition!=="default"){d.wrapper.classList.add(N.transition);
-}if(N.mouseWheel){document.addEventListener("DOMMouseScroll",n,false);document.addEventListener("mousewheel",n,false);}if(N.rollingLinks){J();}}function C(){document.addEventListener("touchstart",y,false);
-document.addEventListener("touchmove",Z,false);document.addEventListener("touchend",S,false);window.addEventListener("hashchange",u,false);if(N.keyboard){document.addEventListener("keydown",aa,false);
-}if(N.controls&&d.controls){d.controlsLeft.addEventListener("click",o(z),false);d.controlsRight.addEventListener("click",o(i),false);d.controlsUp.addEventListener("click",o(s),false);
-d.controlsDown.addEventListener("click",o(D),false);}}function Q(){document.removeEventListener("keydown",aa,false);document.removeEventListener("touchstart",y,false);
-document.removeEventListener("touchmove",Z,false);document.removeEventListener("touchend",S,false);window.removeEventListener("hashchange",u,false);if(N.controls&&d.controls){d.controlsLeft.removeEventListener("click",o(z),false);
+}if(N.progress&&d.progress){d.progress.style.display="block";}if(N.theme&&d.theme){var ad="css/theme/"+N.theme+".css";if(d.theme.getAttribute("href")!==ad){d.theme.setAttribute("href",ad);
+}}if(N.transition!=="default"){d.wrapper.classList.add(N.transition);}if(N.mouseWheel){document.addEventListener("DOMMouseScroll",n,false);document.addEventListener("mousewheel",n,false);
+}if(N.rollingLinks){J();}}function C(){document.addEventListener("touchstart",y,false);document.addEventListener("touchmove",Z,false);document.addEventListener("touchend",S,false);
+window.addEventListener("hashchange",u,false);if(N.keyboard){document.addEventListener("keydown",aa,false);}if(N.controls&&d.controls){d.controlsLeft.addEventListener("click",o(z),false);
+d.controlsRight.addEventListener("click",o(i),false);d.controlsUp.addEventListener("click",o(s),false);d.controlsDown.addEventListener("click",o(D),false);
+}}function Q(){document.removeEventListener("keydown",aa,false);document.removeEventListener("touchstart",y,false);document.removeEventListener("touchmove",Z,false);
+document.removeEventListener("touchend",S,false);window.removeEventListener("hashchange",u,false);if(N.controls&&d.controls){d.controlsLeft.removeEventListener("click",o(z),false);
d.controlsRight.removeEventListener("click",o(i),false);d.controlsUp.removeEventListener("click",o(s),false);d.controlsDown.removeEventListener("click",o(D),false);
}}function r(ae,ad){for(var af in ad){ae[af]=ad[af];}}function O(af,ad){var ag=af.x-ad.x,ae=af.y-ad.y;return Math.sqrt(ag*ag+ae*ae);}function o(ad){return function(ae){ae.preventDefault();
ad.call();};}function X(){setTimeout(function(){window.scrollTo(0,1);},0);}function aa(ae){if(ae.target.contentEditable!="inherit"||ae.shiftKey||ae.altKey||ae.ctrlKey||ae.metaKey){return;
Please sign in to comment.
Something went wrong with that request. Please try again.