hopefully fix click issue

This commit is contained in:
sirjonasxx 2021-10-02 21:06:26 +02:00
parent eb79ea0383
commit 0245d80111

View File

@ -135,6 +135,8 @@ public class GExtensionStoreController implements Initializable {
}
}
private List<? extends ContentItem> currentContentItems; // store so java doesn't garbage collect it!
public void setOverview(boolean scrollTop) {
if (initialized) {
Platform.runLater(() -> {
@ -142,9 +144,10 @@ public class GExtensionStoreController implements Initializable {
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");