Skip to content

Commit

Permalink
Viewer container does not move
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Yu committed Oct 14, 2024
1 parent 0920311 commit c91e7ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 5 additions & 5 deletions viewer/components/gui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export async function patchViewerUI() {

const params = await utils.getParams()

if (params.toolbar === 0) {
const containerDom = document.getElementById('viewerContainer')!
containerDom.style.top = '32px'
}

document.getElementById('outerContainer')!.onmousemove = (e) => {
if (params.toolbar === 0) {
return
Expand All @@ -36,8 +41,6 @@ export async function patchViewerUI() {
hideToolbar = setTimeout(() => {
const toolbarDom = document.getElementsByClassName('toolbar')[0]
toolbarDom.classList.add('hide')
const containerDom = document.getElementById('viewerContainer')!
containerDom.classList.add('topped')
hideToolbar = undefined
}, params.toolbar * 1000)
}
Expand All @@ -48,7 +51,6 @@ export async function patchViewerUI() {
document.getElementById('firstPage')?.previousElementSibling?.classList.add('visibleLargeView')
if (params.toolbar !== 0) {
document.getElementsByClassName('toolbar')[0]?.classList.add('hide')
document.getElementById('viewerContainer')!.classList.add('topped')
}

const template = document.createElement('template')
Expand Down Expand Up @@ -241,6 +243,4 @@ export function repositionAnnotation() {
function showToolbar() {
const toolbarDom = document.getElementsByClassName('toolbar')[0]
toolbarDom.classList.remove('hide')
const containerDom = document.getElementById('viewerContainer')!
containerDom.classList.remove('topped')
}
4 changes: 0 additions & 4 deletions viewer/latexworkshop.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ html[dir='rtl'] .findbar {
}

#viewerContainer {
transition: all 0.2s cubic-bezier(.23,.96,.57,.99) !important;
}

#viewerContainer.topped {
top: 0 !important;
}

Expand Down

0 comments on commit c91e7ce

Please sign in to comment.