mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-12-19 01:01:00 +00:00
a32999e641
Change-Id: Icabf6e065ed5685207731262db72faf848a0a04d
18 lines
530 B
JavaScript
18 lines
530 B
JavaScript
var WATCHED_CLASS = 'mw-ui-icon-wikimedia-unStar-progressive',
|
|
UNWATCHED_CLASS = 'mw-ui-icon-wikimedia-star-base20';
|
|
|
|
/**
|
|
* Tweaks the global watchstar handler in core to use the correct classes for Minerva.
|
|
*
|
|
* @param {jQuery.Object} $icon
|
|
*/
|
|
module.exports = function init( $icon ) {
|
|
$icon.on( 'watchpage.mw', function ( _ev, action ) {
|
|
$( this ).find( 'a' ).removeClass(
|
|
[ WATCHED_CLASS, 'watched', UNWATCHED_CLASS ]
|
|
).addClass(
|
|
action === 'watch' ? [ WATCHED_CLASS, 'watched' ] : UNWATCHED_CLASS
|
|
);
|
|
} );
|
|
};
|