Permalink
Browse files

Merge pull request #131 from Sinetheta/master

theme swap relative to theme file
  • Loading branch information...
hakimel committed Aug 31, 2012
2 parents aa97d80 + 495cb98 commit c411c4d5d292dc837eb7ff5be316582f44ea0e2b
Showing with 11 additions and 72 deletions.
  1. +8 −5 js/reveal.js
  2. +3 −67 js/reveal.min.js
View
@@ -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(){
}
};
-})();
-
+})();
Oops, something went wrong.

0 comments on commit c411c4d

Please sign in to comment.