mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Reduce some duplication when toggling "expanded" buttons in the viewer toolbars
This is very similar to PR 16281, but for buttons that use the "aria-expanded" attribute.
This commit is contained in:
parent
d520754bcf
commit
362be760e3
4 changed files with 17 additions and 16 deletions
|
@ -851,6 +851,13 @@ function toggleCheckedBtn(button, toggle, view = null) {
|
|||
view?.classList.toggle("hidden", !toggle);
|
||||
}
|
||||
|
||||
function toggleExpandedBtn(button, toggle, view = null) {
|
||||
button.classList.toggle("toggled", toggle);
|
||||
button.setAttribute("aria-expanded", toggle);
|
||||
|
||||
view?.classList.toggle("hidden", !toggle);
|
||||
}
|
||||
|
||||
export {
|
||||
animationStarted,
|
||||
apiPageLayoutToViewerModes,
|
||||
|
@ -891,6 +898,7 @@ export {
|
|||
SpreadMode,
|
||||
TextLayerMode,
|
||||
toggleCheckedBtn,
|
||||
toggleExpandedBtn,
|
||||
UNKNOWN_SCALE,
|
||||
VERTICAL_PADDING,
|
||||
watchScroll,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue