MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 429: Line 429:
         var timestamp = new Date().getTime();
         var timestamp = new Date().getTime();
         $('body').toggleClass('dark-mode');
         $('body').toggleClass('dark-mode');
        var notif = $('.dark-mode-notif[data-time="'+timestamp+'"]');
         var otherNotif = $('.dark-mode-notif:not([data-time="'+timestamp+'"])');
         var otherNotif = $('.dark-mode-notif:not([data-time="'+timestamp+'"])');
         otherNotif.remove();
         otherNotif.remove();
Line 440: Line 439:
             $(this).after('<div class="dark-mode-notif" data-state="off" data-time="'+timestamp+'"></div>');
             $(this).after('<div class="dark-mode-notif" data-state="off" data-time="'+timestamp+'"></div>');
         }
         }
        var notif = $('.dark-mode-notif[data-time="'+timestamp+'"]');
         notif.show();
         notif.show();
         setTimeout(function(){
         setTimeout(function(){