Skip to content

Commit

Permalink
Disposes open listener
Browse files Browse the repository at this point in the history
  • Loading branch information
darrellcolehill committed Jun 17, 2024
1 parent cdbe4ed commit 2c07cc0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import javafx.stage.Window
import org.wycliffeassociates.otter.jvm.controls.chapterselector.ChapterGrid
import org.wycliffeassociates.otter.jvm.controls.customizeScrollbarSkin
import org.wycliffeassociates.otter.jvm.controls.model.ChapterGridItemData
import org.wycliffeassociates.otter.jvm.utils.ListenerDisposer
import org.wycliffeassociates.otter.jvm.utils.onChangeWithDisposer
import tornadofx.*

Expand Down Expand Up @@ -62,6 +63,7 @@ class ChapterSelectorPopupSkin(
) : Skin<ChapterSelectorPopup> {

private lateinit var scrollPane: ScrollPane
private val openListenerDisposer: ListenerDisposer

private val root = VBox().apply {
addClass("chapter-selector-popup")
Expand All @@ -83,7 +85,7 @@ class ChapterSelectorPopupSkin(
if (it == true) {
scrollToSelected()
}
}
}.apply { openListenerDisposer = this }
}

private fun scrollToSelected() {
Expand All @@ -105,6 +107,6 @@ class ChapterSelectorPopupSkin(
}

override fun dispose() {

openListenerDisposer.dispose()
}
}

0 comments on commit 2c07cc0

Please sign in to comment.