no title toggle, default dark

This commit is contained in:
Meutel 2018-12-22 17:42:24 +01:00
parent 13dfc43bbd
commit 6c8ea56f56

View File

@ -19,19 +19,9 @@ jQuery(function($) {
}
_Blog.changeTitle = function() {
var currentTitle = document.title;
window.onblur = function() {
document.title = 'I miss you!';
}
window.onfocus = function() {
document.title = currentTitle;
}
};
_Blog.toggleTheme = function() {
const currentTheme = window.localStorage && window.localStorage.getItem('theme')
const isDark = currentTheme === 'dark'
const isDark = currentTheme === undefined || currentTheme === 'dark'
$('body').toggleClass('dark-theme', isDark)
$('.theme-switch').on('click', () => {
$('body').toggleClass('dark-theme')
@ -49,8 +39,7 @@ jQuery(function($) {
$(document).ready(function() {
_Blog.prettify()
_Blog.changeTitle()
_Blog.toggleTheme()
_Blog.toggleMobileMenu()
});
});
});