From 0c06469d82fbc0ca2f4a2bf2d07e9e5a04cfc37f Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 30 Aug 2012 01:13:25 -0400 Subject: [PATCH] prevent same theme from loading repeatedly --- js/reveal.js | 6 +++++- js/reveal.min.js | 13 +++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 31b9bf12..593c32d6 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 cdc904a0..a8161bf0 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