Add page numbers
This commit is contained in:
parent
67388f2a7e
commit
e3866d62e0
@ -9,6 +9,8 @@ let topicList;
|
|||||||
let topicLinks;
|
let topicLinks;
|
||||||
let topicListSearch;
|
let topicListSearch;
|
||||||
|
|
||||||
|
let pageNumberContainer;
|
||||||
|
|
||||||
const activeTopicLinkClass = 'active-topic-link';
|
const activeTopicLinkClass = 'active-topic-link';
|
||||||
const notMatchingSearchTermsClass = 'not-matching-search-terms';
|
const notMatchingSearchTermsClass = 'not-matching-search-terms';
|
||||||
const topicListSearchClass = 'topic-list-search';
|
const topicListSearchClass = 'topic-list-search';
|
||||||
@ -19,6 +21,7 @@ function init() {
|
|||||||
slides[i].id = `slide${i}`;
|
slides[i].id = `slide${i}`;
|
||||||
}
|
}
|
||||||
topicList = createTopicList();
|
topicList = createTopicList();
|
||||||
|
pageNumberContainer = document.getElementById('page-number-container');
|
||||||
resumeOrGoToStart();
|
resumeOrGoToStart();
|
||||||
document.addEventListener('keydown', onKeyPressed);
|
document.addEventListener('keydown', onKeyPressed);
|
||||||
}
|
}
|
||||||
@ -46,6 +49,10 @@ function goToSlide(index) {
|
|||||||
[...newActiveTopicLinks].forEach(link => {
|
[...newActiveTopicLinks].forEach(link => {
|
||||||
link.classList.add(activeTopicLinkClass);
|
link.classList.add(activeTopicLinkClass);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (pageNumberContainer) {
|
||||||
|
pageNumberContainer.textContent = index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user