From 42294d204d10c662edc430a1ffd29f586cf62c46 Mon Sep 17 00:00:00 2001 From: Abdullah Alfaraj Date: Tue, 3 Oct 2023 06:37:11 +0300 Subject: [PATCH] add scroll to buttons for the history and lexica panels. --- typescripts/tool_bar/tool_bar.tsx | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/typescripts/tool_bar/tool_bar.tsx b/typescripts/tool_bar/tool_bar.tsx index 9d5a50c8..af8481bb 100644 --- a/typescripts/tool_bar/tool_bar.tsx +++ b/typescripts/tool_bar/tool_bar.tsx @@ -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 { @@ -202,6 +221,22 @@ class ToolBar extends React.Component<{}> { > C + + )