mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 05:13:33 -06:00
Merge branch 'improvement/custom-themes' of git://github.com/SgtSilvio/just-the-docs into SgtSilvio-improvement/custom-themes
This commit is contained in:
@@ -279,11 +279,25 @@ function initSearch() {
|
||||
}
|
||||
}
|
||||
|
||||
// Focus
|
||||
|
||||
function pageFocus() {
|
||||
var mainContent = document.querySelector('.js-main-content');
|
||||
mainContent.focus();
|
||||
}
|
||||
|
||||
// Switch theme
|
||||
|
||||
jtd.getTheme = function() {
|
||||
var cssFileHref = document.querySelector('[rel="stylesheet"]').getAttribute('href');
|
||||
return cssFileHref.substring(cssFileHref.lastIndexOf('-') + 1, cssFileHref.length - 4);
|
||||
}
|
||||
|
||||
jtd.setTheme = function(theme) {
|
||||
var cssFile = document.querySelector('[rel="stylesheet"]');
|
||||
cssFile.setAttribute('href', '{{ "assets/css/just-the-docs-" | absolute_url }}' + theme + '.css');
|
||||
}
|
||||
|
||||
// Document ready
|
||||
|
||||
jtd.onReady(function(){
|
||||
|
Reference in New Issue
Block a user