Execute search when user changes search mode
This commit is contained in:
parent
239d0d7da2
commit
573515217e
@ -24,5 +24,14 @@ class SearchController(private val model: Model) {
|
||||
val searchMode = searchModeToggleGroup.selectedToggle.userData as SearchMode
|
||||
model.search(newValue, searchMode)
|
||||
}
|
||||
|
||||
searchModeToggleGroup.selectedToggleProperty().addListener { _, _, newValue ->
|
||||
if (textFieldSearch.text.isNullOrBlank()) {
|
||||
return@addListener
|
||||
}
|
||||
|
||||
val searchMode = newValue.userData as SearchMode
|
||||
model.search(textFieldSearch.text, searchMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user