avoid empty search-results
show # results also uf term is entered by user without #
This commit is contained in:
parent
092c7d880f
commit
c22254364e
1 changed files with 30 additions and 1 deletions
|
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue