[ADD] page-count classes for element visibility

These classes cause the element to be visible when the document is only a single page long (for single-page) or when it's multiple pages long (for multi-page). This is especially useful for page counters, which can be hidden when there's only a single page.
pull/737/head
AlienAtSystem 2023-03-20 11:10:24 +01:00 committed by GitHub
parent e8930c6c0a
commit 059e8d4ec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -44,6 +44,12 @@
'last-page': function (elt) {
elt.style.visibility = (vars.sitepage == vars.sitepages) ? "visible" : "hidden";
},
'single-page': function (elt) {
elt.style.display = (vars.sitepages === 1) ? "inherit" : "none";
},
'multi-page': function (elt) {
elt.style.display = (vars.sitepages > 1) ? "inherit" : "none";
},
};
for (var klass in operations) {
var y = document.getElementsByClassName(klass);