From: Hakim El Hattab Date: Thu, 30 Aug 2012 05:13:25 +0000 (-0400) Subject: prevent same theme from loading repeatedly X-Git-Tag: 2.0.0~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0c06469d82fbc0ca2f4a2bf2d07e9e5a04cfc37f;p=reveal.js.git prevent same theme from loading repeatedly --- 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