File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export class BookPlayer {
3232 this . type = PluginType . MediaPlayer ;
3333 this . id = 'bookplayer' ;
3434 this . priority = 1 ;
35+ this . THEMES = THEMES ;
3536 if ( ! userSettings . theme ( ) || userSettings . theme ( ) === 'dark' ) {
3637 this . theme = 'dark' ;
3738 } else {
Original file line number Diff line number Diff line change 2222
2323 #btnBookplayerToc {
2424 float : left ;
25- margin-left : 2vw ;
25+ margin : 0.5 vh 0.5 vh 0.5 vh 2vw ;
2626 }
2727
2828 #btnBookplayerExit {
2929 float : right ;
30- margin-right : 2vw ;
30+ margin : 0.5 vh 2vw 0.5 vh 0.5 vh ;
3131 }
3232
3333 .bookplayerErrorMsg {
4646 width : fit-content ;
4747 max-height : 80% ;
4848 max-width : 60% ;
49- padding-right : 50px ;
50- padding-bottom : 15px ;
5149
5250 .bookplayerButtonIcon {
5351 color : black ;
5452 }
5553
54+ .bookplayerButton {
55+ margin : 0.5vh ;
56+ }
57+
58+ .toc {
59+ margin : 0 ;
60+ padding : 30px ;
61+ }
62+
5663 .toc li {
5764 margin-bottom : 5px ;
5865
8087 }
8188 }
8289}
90+
91+ @media (max-width : 60em ) {
92+ #dialogToc {
93+ max-width : 100% ;
94+ max-height : 100% ;
95+ }
96+ }
Original file line number Diff line number Diff line change 11import escapeHTML from 'escape-html' ;
22import dialogHelper from '../../components/dialogHelper/dialogHelper' ;
3+ import layoutManager from 'components/layoutManager' ;
34
45export default class TableOfContents {
56 constructor ( bookPlayer ) {
@@ -57,7 +58,7 @@ export default class TableOfContents {
5758
5859 // remove parent directory reference from href to fix certain books
5960 const link = chapter . href . startsWith ( '../' ) ? chapter . href . slice ( 3 ) : chapter . href ;
60- itemHtml += `<a href="${ escapeHTML ( book . path . directory + link ) } ">${ escapeHTML ( chapter . label ) } </a>` ;
61+ 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>` ;
6162
6263 if ( chapter . subitems ?. length ) {
6364 const subHtml = chapter . subitems
@@ -85,7 +86,7 @@ export default class TableOfContents {
8586 let tocHtml = '<div class="topRightActionButtons">' ;
8687 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>' ;
8788 tocHtml += '</div>' ;
88- tocHtml += ' <ul class="toc">' ;
89+ tocHtml += ` <ul style="background-color: ${ layoutManager . mobile ? this . bookPlayer . THEMES [ this . bookPlayer . theme ] . body . background : 'inherit' } " class="toc">` ;
8990 rendition . book . navigation . forEach ( ( chapter ) => {
9091 tocHtml += this . chapterTocItem ( rendition . book , chapter ) ;
9192 } ) ;
You can’t perform that action at this time.
0 commit comments