aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab2012-08-31 07:46:54 -0700
committerHakim El Hattab2012-08-31 07:46:54 -0700
commitc411c4d5d292dc837eb7ff5be316582f44ea0e2b (patch)
tree19eaafdb9644415c658bf8aff6a30aa8d193c18b /js/reveal.js
parentaa97d80d5379f45cdd60c71371f628a4f1413d8d (diff)
parent495cb98005686748d3c923273b1061837c0756ee (diff)
Merge pull request #131 from Sinetheta/master
theme swap relative to theme file
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 593c32d..1943e15 100644
--- a/js/reveal.js
+++ b/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(){
}
};
-})();
-
+})(); \ No newline at end of file