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