keep existing dialog style on desktop layout

This commit is contained in:
dkanada
2025-11-27 16:00:39 +09:00
parent 74f98bb120
commit 9af155b291

View File

@@ -1,5 +1,6 @@
import escapeHTML from 'escape-html';
import dialogHelper from '../../components/dialogHelper/dialogHelper';
import layoutManager from 'components/layoutManager';
export default class TableOfContents {
constructor(bookPlayer) {
@@ -57,7 +58,7 @@ export default class TableOfContents {
// remove parent directory reference from href to fix certain books
const link = chapter.href.startsWith('../') ? chapter.href.slice(3) : chapter.href;
itemHtml += `<a style="color: ${this.bookPlayer.THEMES[this.bookPlayer.theme].body.color}" href="${escapeHTML(book.path.directory + link)}">${escapeHTML(chapter.label)}</a>`;
itemHtml += `<a style="color: ${layoutManager.mobile ? this.bookPlayer.THEMES[this.bookPlayer.theme].body.color : 'inherit'}" href="${escapeHTML(book.path.directory + link)}">${escapeHTML(chapter.label)}</a>`;
if (chapter.subitems?.length) {
const subHtml = chapter.subitems
@@ -85,7 +86,7 @@ export default class TableOfContents {
let tocHtml = '<div class="topRightActionButtons">';
tocHtml += '<button is="paper-icon-button-light" class="autoSize bookplayerButton btnBookplayerTocClose hide-mouse-idle-tv" tabindex="-1"><span class="material-icons bookplayerButtonIcon close" aria-hidden="true"></span></button>';
tocHtml += '</div>';
tocHtml += `<ul style="background-color: ${this.bookPlayer.THEMES[this.bookPlayer.theme].body.background}" class="toc">`;
tocHtml += `<ul style="background-color: ${layoutManager.mobile ? this.bookPlayer.THEMES[this.bookPlayer.theme].body.background : 'inherit'}" class="toc">`;
rendition.book.navigation.forEach((chapter) => {
tocHtml += this.chapterTocItem(rendition.book, chapter);
});