mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Simplify code with object shorthand syntax
This commit is contained in:
parent
a3c330b4e1
commit
cf5d65d86e
5 changed files with 23 additions and 28 deletions
|
@ -99,12 +99,7 @@ function getIconsHtml(options) {
|
|||
}
|
||||
|
||||
const iconCssClass = options.iconCssClass;
|
||||
|
||||
const classes = {
|
||||
buttonCssClass: btnCssClass,
|
||||
iconCssClass: iconCssClass
|
||||
};
|
||||
|
||||
const classes = { buttonCssClass: btnCssClass, iconCssClass: iconCssClass };
|
||||
const serverId = item.ServerId;
|
||||
|
||||
if (includePlayed !== false) {
|
||||
|
@ -113,7 +108,7 @@ function getIconsHtml(options) {
|
|||
if (itemHelper.canMarkPlayed(item)) {
|
||||
if (userData.Played) {
|
||||
const buttonCssClass = classes.buttonCssClass + ' btnUserDataOn';
|
||||
html += getUserDataButtonHtml('markPlayed', itemId, serverId, 'check', tooltipPlayed, style, {buttonCssClass: buttonCssClass, ...classes});
|
||||
html += getUserDataButtonHtml('markPlayed', itemId, serverId, 'check', tooltipPlayed, style, { buttonCssClass, ...classes });
|
||||
} else {
|
||||
html += getUserDataButtonHtml('markPlayed', itemId, serverId, 'check', tooltipPlayed, style, classes);
|
||||
}
|
||||
|
@ -123,7 +118,7 @@ function getIconsHtml(options) {
|
|||
const tooltipFavorite = globalize.translate('Favorite');
|
||||
if (userData.IsFavorite) {
|
||||
const buttonCssClass = classes.buttonCssClass + ' btnUserData btnUserDataOn';
|
||||
html += getUserDataButtonHtml('markFavorite', itemId, serverId, 'favorite', tooltipFavorite, style, {buttonCssClass: buttonCssClass, ...classes});
|
||||
html += getUserDataButtonHtml('markFavorite', itemId, serverId, 'favorite', tooltipFavorite, style, { buttonCssClass, ...classes });
|
||||
} else {
|
||||
classes.buttonCssClass += ' btnUserData';
|
||||
html += getUserDataButtonHtml('markFavorite', itemId, serverId, 'favorite', tooltipFavorite, style, classes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue