From 7b87bd9f236fdff6eb88a248adb10895476632a3 Mon Sep 17 00:00:00 2001 From: Dylan <55002846+ohitsdylan@users.noreply.github.com> Date: Mon, 17 Feb 2020 10:38:43 -0500 Subject: [PATCH] condense theme swap function using toggleClass instead of add/removeClass --- nullboard.html | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/nullboard.html b/nullboard.html index c1df9a0..07cd4a3 100644 --- a/nullboard.html +++ b/nullboard.html @@ -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; });