MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 427: Line 427:


     $('#dark-mode-switch').click(function () {
     $('#dark-mode-switch').click(function () {
         var timestamp = new Date().getTime();
         var state = $('body').hasClass('dark-mode') ? 'off' : 'on';
         $(this).after('<div class="dark-mode-notif" data-state="'+ $('body').hasClass('dark-mode') ? 'off' : 'on' +'"></div>');
         $(this).after('<div class="dark-mode-notif" data-state="'+state+'"></div>');
         $('body').toggleClass('dark-mode');
         $('body').toggleClass('dark-mode');
         var otherNotif = $('.dark-mode-notif:not(:last-of-type)');
         var otherNotif = $('.dark-mode-notif:not(:last-of-type)');