Skip to content

Commit

Permalink
Stop hiding toolbarButtonSpacer
Browse files Browse the repository at this point in the history
  • Loading branch information
tamuratak committed Oct 7, 2024
1 parent 77b207b commit 9de076a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions viewer/components/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,15 @@ export function setCssRuleForToolbar() {
const numPages = document.getElementById('numPages') as HTMLElement
const numPagesWidth = elementWidth(numPages)
const printerButtonWidth = isEmbedded ? 0 : 34
// The constant must be larger than 366 = 28 + 28 + 28 + 30 + 28 + 28 + 28 + 56 + 28 + 28 + 28 + 28
// It is the sum of the widths of the elements in the toolbar except for numPages and printerButton.
// The constant must be larger than 410 = 28 + 28 + 28 + 30 + 28 + 28 + 28 + 56 + 28 + 28 + 28 + 28 + 130 - 86
// It is the sum of the widths of the elements in the toolbar except for numPages, printerButton, and trimSelectContainer.
const trimMaxWidth = 500 + numPagesWidth + printerButtonWidth
const scaleMaxWidth = scaleWidth + trimMaxWidth
// The constant must be larger than 86 = 28 + 28 + 30
// It is the sum of the widths of toolbarButtonSpacer, previous, and next.
const smallViewMaxWidth = 86 + scaleMaxWidth
styleSheet.insertRule(` @media all and (max-width: ${smallViewMaxWidth}px) {
.hiddenSmallView, .hiddenSmallView * { display: none; }
.toolbarButtonSpacer { width: 0 !important; }
}`)
styleSheet.insertRule(`@media all and (max-width: ${scaleMaxWidth}px) { #scaleSelectContainer { display: none; } }`)
const smallViewMaxWidth = 90 + scaleMaxWidth
styleSheet.insertRule(`@media all and (max-width: ${trimMaxWidth}px) { #trimSelectContainer { display: none; } }`)
styleSheet.insertRule(`@media all and (max-width: ${scaleMaxWidth}px) { #scaleSelectContainer { display: none; } }`)
styleSheet.insertRule(` @media all and (max-width: ${smallViewMaxWidth}px) { .hiddenSmallView { display: none; } }`)
document.adoptedStyleSheets.push(styleSheet)
}

0 comments on commit 9de076a

Please sign in to comment.