Fixes Watchstar display when clicked

Bug: T376359
Change-Id: Iaeda67b6ef063596a9c4ba43084aa6bc2472e0e7
This commit is contained in:
Jon Robson 2024-10-04 12:14:21 -07:00 committed by Jdlrobson
parent 678d02b1cd
commit 3bf80a62ef
4 changed files with 10 additions and 8 deletions

View file

@ -223,9 +223,6 @@ class ToolbarBuilder {
$this->permissions->isAllowed( IMinervaPagePermissions::WATCH )
);
$icon = $watchData['icon'] ?? '';
if ( $icon ) {
$icon .= $watchKey === 'unwatch' ? '-progressive' : '-base20';
}
return $entry->trackClicks( $watchKey )
->setIcon( $icon )
->setTitle( $this->context->msg( $watchKey ) )

View file

@ -4,7 +4,12 @@
transition: transform 0.5s;
}
.minerva-icon--unStar-progressive {
.minerva-icon--unStar {
transform: rotate( 72deg );
}
.minerva-icon--halfStar,
.minerva-icon--unStar {
background: @color-progressive;
}
}

View file

@ -1,7 +1,7 @@
const watchstar = require( 'mediawiki.page.watch.ajax' ).watchstar;
const WATCHED_ICON_CLASS = 'minerva-icon--unStar-progressive';
const TEMP_WATCHED_ICON_CLASS = 'minerva-icon--halfStar-progressive';
const UNWATCHED_ICON_CLASS = 'minerva-icon--star-base20';
const WATCHED_ICON_CLASS = 'minerva-icon--unStar';
const TEMP_WATCHED_ICON_CLASS = 'minerva-icon--halfStar';
const UNWATCHED_ICON_CLASS = 'minerva-icon--star';
/**
* Tweaks the global watchstar handler in core to use the correct classes for Minerva.

View file

@ -40,7 +40,7 @@ class ArticlePage extends MinervaPage {
}
get watched_element() {
return $( '.minerva-icon--unStar-progressive' );
return $( '.minerva-icon--unStar' );
}
get menu_button_element() {