Skip to content

Commit

Permalink
add scroll to buttons for the history and lexica panels.
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdullahAlfaraj committed Oct 3, 2023
1 parent 7ad9a7e commit 42294d2
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions typescripts/tool_bar/tool_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,25 @@ function scrollToPreview() {
console.error(e)
}
}
function scrollToHistory() {
try {
document
.querySelector('#search_second_panel > div#historyImagesContainer')!
.scrollIntoView()
} catch (e) {
console.error(e)
}
}
function scrollToLexica() {
try {
document
.querySelector('#search_second_panel > div.lexicaContainer')!
.scrollIntoView()
} catch (e) {
console.error(e)
}
}

@observer
class ToolBar extends React.Component<{}> {
componentDidMount(): void {
Expand Down Expand Up @@ -202,6 +221,22 @@ class ToolBar extends React.Component<{}> {
>
C
</button>
<button
id=""
className="btnSquare svgButton"
title="Quickly jump to the History Panel"
onClick={scrollToHistory}
>
H
</button>
<button
id=""
className="btnSquare svgButton"
title="Quickly jump to the Lexica Panel"
onClick={scrollToLexica}
>
L
</button>
</div>
</div>
)
Expand Down

0 comments on commit 42294d2

Please sign in to comment.