2019-09-19 21:19:07 +00:00
|
|
|
var WATCHED_CLASS = 'mw-ui-icon-wikimedia-unStar-progressive',
|
|
|
|
UNWATCHED_CLASS = 'mw-ui-icon-wikimedia-star-base20';
|
|
|
|
|
2019-09-18 23:07:21 +00:00
|
|
|
/**
|
2019-09-19 21:19:07 +00:00
|
|
|
* Tweaks the global watchstar handler in core to use the correct classes for Minerva.
|
|
|
|
* @param {jQuery.Object} $icon
|
2019-09-18 23:07:21 +00:00
|
|
|
*/
|
2019-09-19 21:19:07 +00:00
|
|
|
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
|
|
|
|
);
|
|
|
|
} );
|
2019-09-18 23:07:21 +00:00
|
|
|
};
|