Commit d7301951 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Simplify clear search logic, centralize within the TextField

parent 5a0f3a8f
......@@ -40,10 +40,6 @@ Kirigami.GlobalDrawer {
Navigation.openHome();
}
function clearSearch() {
searchField.text = ""
}
onCurrentSubMenuChanged: {
if (currentSubMenu)
currentSubMenu.trigger()
......@@ -84,7 +80,14 @@ Kirigami.GlobalDrawer {
ignoreUnknownSignals: true
target: window.leftPage
onClearSearch: {
drawer.clearSearch()
searchField.text = ""
}
}
Connections {
target: window
onLeftPageChanged: {
searchField.text = ""
}
}
......
......@@ -38,9 +38,9 @@ function openApplicationMime(mime) {
}
function openApplicationList(props) {
var page = window.stack.push(applicationListComp, props)
window.stack.push(applicationListComp, props)
if (props.search === "")
page.clearSearch()
window.globalDrawer.clearSearch();
}
function openCategory(cat, search) {
......@@ -64,6 +64,5 @@ function openHome() {
if (window.globalDrawer.currentSubMenu)
window.globalDrawer.resetMenu();
clearStack()
window.globalDrawer.clearSearch();
window.stack.push(topBrowsingComp)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment