mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-09 12:19:46 -04:00
Merge a7dccd8b073bf507d16b164f4520fbd7fdbd899d into 0b2246eee0eef7c3ffbc33cdc5fbf743a5ddc6fe
This commit is contained in:
commit
3f0dce1a48
@ -7401,6 +7401,21 @@ function setupTableOfContents () {
|
||||
var tableOfContents = new uiUtil.ToC(innerDoc);
|
||||
var headings = tableOfContents.getHeadingObjects();
|
||||
|
||||
if(headings.length <= 1) {
|
||||
var dropupElement = document.getElementById('dropup');
|
||||
dropupElement.classList.remove('btn-default');
|
||||
dropupElement.style.pointerEvents = 'none';
|
||||
dropupElement.innerHTML = '<b> ToC </b>';
|
||||
document.getElementById('ToCList').style.visibility = 'hidden';
|
||||
return;
|
||||
}else {
|
||||
var dropupElement = document.getElementById('dropup');
|
||||
dropupElement.classList.add('btn-default');
|
||||
dropupElement.style.pointerEvents = 'auto';
|
||||
dropupElement.innerHTML = '<b> ToC </b><span class="caret"></span>';
|
||||
document.getElementById('ToCList').style.visibility = 'visible';
|
||||
}
|
||||
|
||||
dropup.style.fontSize = ~~(params.relativeUIFontSize * 0.14) + 'px';
|
||||
var dropupHtml = '';
|
||||
headings.forEach(function (heading) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user