1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Make title of ratingbutton state-dependent

This commit is contained in:
Dmitry Lyzo 2022-02-24 18:37:32 +03:00
parent 26bf0d532b
commit 9f302dbf72
2 changed files with 7 additions and 4 deletions

View file

@ -88,10 +88,12 @@ import ServerConnections from '../../components/ServerConnections';
button.setAttribute('data-likes', (likes === null ? '' : likes));
}
setTitle(button, isFavorite);
}
function setTitle(button) {
button.title = globalize.translate('Favorite');
function setTitle(button, isFavorite) {
button.title = isFavorite ? globalize.translate('Favorite') : globalize.translate('AddToFavorites');
const text = button.querySelector('.button-text');
if (text) {
@ -141,9 +143,9 @@ import ServerConnections from '../../components/ServerConnections';
setState(this, likes, isFavorite, false);
bindEvents(this);
} else {
setTitle(this);
}
setTitle(this);
};
EmbyRatingButtonPrototype.detachedCallback = function () {