Browse Source

ToC

pull/61/head
Jure Šorn 4 years ago
parent
commit
4562485fe1
1 changed files with 4 additions and 3 deletions
  1. 7
      web/script_2.js

7
web/script_2.js

@ -55,16 +55,17 @@ if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine
} }
var TOC_SCREEN_WIDTH_CUTOFF = 667 var TOC_SCREEN_WIDTH_CUTOFF = 667
var TOC_EM = '1.8em'
if (isMobile && window.screen.width < TOC_SCREEN_WIDTH_CUTOFF) { if (isMobile && window.screen.width < TOC_SCREEN_WIDTH_CUTOFF) {
$(`code:contains(ToC)`).html(TOC_MOBILE).css("line-height", "1.8em");
$(`code:contains(ToC)`).html(TOC_MOBILE).css("line-height", TOC_EM);
} }
function updateToc() { function updateToc() {
if (isMobile && window.screen.width < TOC_SCREEN_WIDTH_CUTOFF) { if (isMobile && window.screen.width < TOC_SCREEN_WIDTH_CUTOFF) {
$(`code:contains(ToC)`).html(TOC_MOBILE).css("line-height", "1.8em");
$(`code:contains(ToC)`).html(TOC_MOBILE).css("line-height", TOC_EM);
} else { } else {
$(`code:contains(ToC)`).html(TOC).css("line-height", "1.8em");
$(`code:contains(ToC)`).html(TOC).css("line-height", TOC_EM);
} }
} }
window.addEventListener("orientationchange", updateToc, false); window.addEventListener("orientationchange", updateToc, false);

Loading…
Cancel
Save