Merge pull request #62 from molan-git/search-ui
avoid empty search-results
This commit is contained in:
commit
262a6352d4
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