mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix 'undefined' on Chromecast and cleanup on nowPlayingBar.js
This commit is contained in:
parent
6aae85e991
commit
d13e1acf8d
3 changed files with 30 additions and 22 deletions
|
@ -457,15 +457,6 @@ define(['require', 'datetime', 'itemHelper', 'events', 'browser', 'imageLoader',
|
|||
}
|
||||
}
|
||||
|
||||
function getTextActionButton(item, text) {
|
||||
|
||||
if (!text) {
|
||||
text = itemHelper.getDisplayName(item);
|
||||
}
|
||||
|
||||
return `<a>${text}</a>`;
|
||||
}
|
||||
|
||||
function seriesImageUrl(item, options) {
|
||||
|
||||
if (!item) {
|
||||
|
@ -541,18 +532,25 @@ define(['require', 'datetime', 'itemHelper', 'events', 'browser', 'imageLoader',
|
|||
if (textLines.length > 1) {
|
||||
textLines[1].secondary = true;
|
||||
}
|
||||
nowPlayingTextElement.innerHTML = textLines.map(function (nowPlayingName) {
|
||||
|
||||
var cssClass = nowPlayingName.secondary ? ' class="nowPlayingBarSecondaryText"' : '';
|
||||
|
||||
if (nowPlayingName.item) {
|
||||
var nowPlayingText = getTextActionButton(nowPlayingName.item, nowPlayingName.text);
|
||||
return `<div ${cssClass}>${nowPlayingText}</div>`;
|
||||
if (textLines) {
|
||||
nowPlayingTextElement.innerHTML = '';
|
||||
let itemText = document.createElement('div');
|
||||
let secondaryText = document.createElement('div');
|
||||
secondaryText.classList.add('nowPlayingBarSecondaryText');
|
||||
if (textLines[0].text) {
|
||||
let text = document.createElement('a');
|
||||
text.innerHTML = textLines[0].text;
|
||||
itemText.appendChild(text);
|
||||
}
|
||||
|
||||
return `<div ${cssClass}>${nowPlayingText}</div>`;
|
||||
|
||||
}).join('');
|
||||
if (textLines[1].text) {
|
||||
let text = document.createElement('a');
|
||||
text.innerHTML = textLines[1].text;
|
||||
secondaryText.appendChild(text);
|
||||
}
|
||||
nowPlayingTextElement.appendChild(itemText);
|
||||
nowPlayingTextElement.appendChild(secondaryText);
|
||||
}
|
||||
|
||||
var imgHeight = 70;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue