Merge pull request #62 from molan-git/search-ui

avoid empty search-results
This commit is contained in:
molan-git 2020-06-09 19:08:28 +02:00 committed by GitHub
commit 262a6352d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,7 +84,11 @@ Page {
onSearchChanged: {
console.log(search)
loader.sourceComponent = loading
loader.sourceComponent = search.charAt(0) === "@" ? userListComponent : tagListComponent
if (search.charAt(0) === "@") {
loader.sourceComponent = userListComponent
} else if (search.charAt(0) === "#") {
loader.sourceComponen = tagListComponent
} else { loader.sourceComponent = worldListComponent}
}
Loader {
@ -183,6 +187,31 @@ Page {
}
}
}
Component {
id: wordListComponent
MyList {
id: view3
mdl: ListModel {}
width: parent.width
height: parent.height
onOpenDrawer: infoPanel.open = setDrawer
anchors.fill: parent
currentIndex: -1 // otherwise currentItem will steal focus
header: Item {
id: header
width: headerContainer.width
height: headerContainer.height
Component.onCompleted: headerContainer.parent = header
}
delegate: VisualContainer
Component.onCompleted: {
view3.type = "timelines/tag/"+tlSearch.search
view3.loadData("append")
}
}
}
}
}