Skip to content
Snippets Groups Projects
Commit c411c4d5 authored by Hakim El Hattab's avatar Hakim El Hattab
Browse files

Merge pull request #131 from Sinetheta/master

theme swap relative to theme file
parents aa97d80d 495cb980
No related branches found
No related tags found
No related merge requests found
/*!
* 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(){
}
};
})();
})();
\ No newline at end of file
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment