Ver código fonte

changed theme file swap to be relative to theme file instead of slide-deck

Sinetheta 11 anos atrás
pai
commit
495cb98005
2 arquivos alterados com 10 adições e 7 exclusões
  1. 8 5
      js/reveal.js
  2. 2 2
      js/reveal.min.js

+ 8 - 5
js/reveal.js

@@ -1,5 +1,5 @@
 /*!
- * reveal.js 2.0 r21
+ * reveal.js 2.0 r22
  * http://lab.hakim.se/reveal-js
  * MIT licensed
  * 
@@ -228,12 +228,16 @@ var Reveal = (function(){
 
 		// Load the theme in the config, if it's not already loaded
 		if( config.theme && dom.theme ) {
-			var themeURL = 'css/theme/' + config.theme + '.css';
-			if( dom.theme.getAttribute( 'href' ) !== themeURL ) {
+			var themeURL = dom.theme.getAttribute( 'href' );
+			var themeFinder = /[^/]*?(?=\.css)/;
+			var themeName = themeURL.match(themeFinder)[0];
+			if(  config.theme !== themeName ) {
+				themeURL = themeURL.replace(themeFinder, config.theme);
 				dom.theme.setAttribute( 'href', themeURL );
 			}
 		}
 
+
 		if( config.transition !== 'default' ) {
 			dom.wrapper.classList.add( config.transition );
 		}
@@ -1142,5 +1146,4 @@ var Reveal = (function(){
 		}
 	};
 	
-})();
-
+})();

Diferenças do arquivo suprimidas por serem muito extensas
+ 2 - 2
js/reveal.min.js


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff