Add a load-more button to item list

This commit is contained in:
Eike Kettner
2020-06-06 02:08:20 +02:00
parent e5b90eff34
commit b150269528
9 changed files with 251 additions and 16 deletions

View File

@ -61,6 +61,7 @@ view model =
, not model.menuCollapsed
)
, ( "sixteen wide column", model.menuCollapsed )
, ( "item-card-list", True )
]
]
[ div
@ -90,6 +91,36 @@ view model =
Detail ->
div [] []
]
, div
[ classList
[ ( "sixteen wide column", True )
]
]
[ div [ class "ui basic center aligned segment" ]
[ button
[ classList
[ ( "ui basic tiny button", True )
, ( "disabled", not model.moreAvailable )
, ( "hidden invisible", resultsBelowLimit model )
]
, disabled (not model.moreAvailable || model.moreInProgress || model.searchInProgress)
, title "Load more items"
, href "#"
, onClick LoadMore
]
[ if model.moreInProgress then
i [ class "loading spinner icon" ] []
else
i [ class "angle double down icon" ] []
, if model.moreAvailable then
text "Load more"
else
text "That's all"
]
]
]
]