Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Update PDF.js…
Browse files Browse the repository at this point in the history
… v4.7.76
  • Loading branch information
tamuratak committed Oct 7, 2024
1 parent b69cc46 commit 5f1f2de
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions viewer/components/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,7 @@ export function hidePrintButton() {
// Since the width of the selector of scaling depends on each locale,
// we have to set its `max-width` dynamically on initialization.
export function setCssRuleForToolbar() {
let styleSheet: CSSStyleSheet | undefined
for (const style of document.styleSheets) {
if (style.href && /latextoybox.css/.exec(style.href)) {
styleSheet = style
break
}
}
if (!styleSheet) {
return
}
const styleSheet = new CSSStyleSheet()
const scaleSelectContainer = document.getElementById('scaleSelectContainer') as HTMLElement
const scaleWidth = elementWidth(scaleSelectContainer)
const numPages = document.getElementById('numPages') as HTMLElement
Expand All @@ -64,4 +55,5 @@ export function setCssRuleForToolbar() {
const trimMaxWidth = 500 + numPagesWidth + printerButtonWidth
const trimRule = `@media all and (max-width: ${trimMaxWidth}px) { #trimSelectContainer { display: none; } }`
styleSheet.insertRule(trimRule)
document.adoptedStyleSheets.push(styleSheet)
}

0 comments on commit 5f1f2de

Please sign in to comment.