Skip to content

Commit

Permalink
hopefully fix click issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sirjonasxx committed Oct 2, 2021
1 parent eb79ea0 commit 0245d80
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,19 @@ private void popOverview() {
}
}

private List<? extends ContentItem> currentContentItems; // store so java doesn't garbage collect it!

public void setOverview(boolean scrollTop) {
if (initialized) {
Platform.runLater(() -> {
HOverview overview = currentOverviews.getLast();

Element content_items_container = webView.getEngine().getDocument().getElementById(contentItemsContainer);
WebUtils.clearElement(content_items_container);
for (int i = 0; i < overview.getAmount(); i++) {
ContentItem contentItem = overview.getContentItems().get(i);
contentItem.addHtml(i, extensionStore);

currentContentItems = overview.getContentItems();
for (int i = 0; i < currentContentItems.size(); i++) {
currentContentItems.get(i).addHtml(i, extensionStore);
}
if (scrollTop) {
webView.getEngine().executeScript("document.getElementById('" + contentItemsContainer + "').scrollTop = 0");
Expand Down

0 comments on commit 0245d80

Please sign in to comment.