mirror of
https://github.com/apankrat/nullboard.git
synced 2025-08-02 03:10:22 +02:00
condense theme swap function
using toggleClass instead of add/removeClass
This commit is contained in:
@@ -2441,18 +2441,9 @@
|
|||||||
setupListScrolling();
|
setupListScrolling();
|
||||||
|
|
||||||
//Toggle board theme
|
//Toggle board theme
|
||||||
var mode = 'light';
|
|
||||||
|
|
||||||
$('.theme-swap').click(function() {
|
$('.theme-swap').click(function() {
|
||||||
|
$('body').toggleClass('dark');
|
||||||
if ( mode === 'light') {
|
return false;
|
||||||
$('body').addClass('dark');
|
|
||||||
mode = 'dark';
|
|
||||||
|
|
||||||
} else if (mode === 'dark') {
|
|
||||||
$('body').removeClass('dark');
|
|
||||||
mode = 'light';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user