aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2012-08-30 01:13:25 -0400
committerHakim El Hattab <hakim.elhattab@gmail.com>2012-08-30 01:13:25 -0400
commit0c06469d82fbc0ca2f4a2bf2d07e9e5a04cfc37f (patch)
tree522f89e763c960c23e8ae10e187e3986f4b47dff
parentdc9b93a533d66834687e3360379c85e2482a1a77 (diff)
downloadperl-software-in-gnu-guix-0c06469d82fbc0ca2f4a2bf2d07e9e5a04cfc37f.tar
perl-software-in-gnu-guix-0c06469d82fbc0ca2f4a2bf2d07e9e5a04cfc37f.tar.gz
prevent same theme from loading repeatedly
-rw-r--r--js/reveal.js6
-rw-r--r--js/reveal.min.js13
2 files changed, 12 insertions, 7 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 31b9bf1..593c32d 100644
--- a/js/reveal.js
+++ b/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' ) {
diff --git a/js/reveal.min.js b/js/reveal.min.js
index cdc904a..a8161bf 100644
--- a/js/reveal.min.js
+++ b/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;