MediaWiki:Gadget-dark-mode-toggle.js: Difference between revisions

Content deleted Content added
sync requested update from User:Nardog/dark-mode-toggle.js
per tper
Line 34:
 
function vectorStickyCallback() {
makePortletLink('p-personal-sticky-header', 'pt-darkmode-sticky-header', '#pt-watchlist-sticky-header');
mw.hook('vector.page_title_scroll').remove(vectorStickyCallback);
if (document.getElementById('pt-darkmode-sticky-header')) return;
makePortletLink('p-personal-sticky-header', 'pt-darkmode-sticky-header', '#pt-watchlist-sticky-header');
}
 
Line 59 ⟶ 60:
toggleMode();
});
 
// Work around lack of icon in Vector 2022
if (mw.config.get('skin') === 'vector-2022') {
$('#' + portletId + ' span:only-child')
.before($('<span>').addClass('mw-ui-icon mw-ui-icon-vector-gadget-pt-darkmode'));
}
}