mirror of
https://github.com/apankrat/nullboard.git
synced 2025-01-17 04:38:27 +01:00
condense theme swap function
using toggleClass instead of add/removeClass
This commit is contained in:
parent
78c1024a29
commit
7b87bd9f23
@ -2441,18 +2441,9 @@
|
||||
setupListScrolling();
|
||||
|
||||
//Toggle board theme
|
||||
var mode = 'light';
|
||||
|
||||
$('.theme-swap').click(function() {
|
||||
|
||||
if ( mode === 'light') {
|
||||
$('body').addClass('dark');
|
||||
mode = 'dark';
|
||||
|
||||
} else if (mode === 'dark') {
|
||||
$('body').removeClass('dark');
|
||||
mode = 'light';
|
||||
}
|
||||
$('body').toggleClass('dark');
|
||||
return false;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user