From 0245d801116b36021e98c9bb3b45b6e0fad275a6 Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Sat, 2 Oct 2021 21:06:26 +0200 Subject: [PATCH] hopefully fix click issue --- .../application/GExtensionStoreController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/GExtensionStoreController.java b/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/GExtensionStoreController.java index d051ded..d22ae0e 100644 --- a/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/GExtensionStoreController.java +++ b/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/GExtensionStoreController.java @@ -135,6 +135,8 @@ public class GExtensionStoreController implements Initializable { } } + private List 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");