ElEditors, Interface administrators, Administrators
70,857
edits
No edit summary |
No edit summary |
||
Line 428: | Line 428: | ||
$('#dark-mode-switch').click(function () { | $('#dark-mode-switch').click(function () { | ||
var timestamp = new Date().getTime(); | var timestamp = new Date().getTime(); | ||
$(this).after('<div class="dark-mode-notif" data-state="'+ $('body').hasClass('dark-mode') ? 'off' : 'on' +'"></div>'); | |||
$('body').toggleClass('dark-mode'); | $('body').toggleClass('dark-mode'); | ||
var otherNotif = $('.dark-mode-notif:not( | var otherNotif = $('.dark-mode-notif:not(eq(0))'); | ||
otherNotif.remove(); | otherNotif.remove(); | ||
var notif = $('.dark-mode-notif:eq(0)'); | |||
var notif = $('.dark-mode-notif | |||
notif.show(); | notif.show(); | ||
setTimeout(function(){ | setTimeout(function(){ | ||
Line 447: | Line 440: | ||
}, 300); | }, 300); | ||
}, 3000); | }, 3000); | ||
matchHeaderText(true); | |||
if ($('body').hasClass('dark-mode')) { | |||
setCookie('elwiki-dark-mode', 'true'); | |||
} else { | |||
setCookie('elwiki-dark-mode', 'false'); | |||
} | |||
}); | }); | ||