Add indicator to search infinite scroll
This commit is contained in:
parent
0971fcd8a3
commit
a70f789a8d
2 changed files with 13 additions and 2 deletions
|
@ -14,7 +14,7 @@ body.page-searchpage {
|
|||
max-width: 80%;
|
||||
}
|
||||
|
||||
#search-indicator.htmx-request {
|
||||
.htmx-request {
|
||||
animation: search-loading 1.5s linear infinite;
|
||||
}
|
||||
|
||||
|
@ -45,4 +45,12 @@ body.page-searchpage {
|
|||
.listing-item {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.search-page-indicator {
|
||||
width: 100%;
|
||||
|
||||
&:not(.htmx-request) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,5 +7,8 @@
|
|||
{% if not results and page_num == 1 %}<p>No results found</p>{% endif %}
|
||||
|
||||
{% if results.has_next %}
|
||||
<span hx-get="{{ search_url }}{% querystring page=results.next_page_number %}" hx-trigger="revealed" hx-swap="outerHTML"></span>
|
||||
<span hx-get="{{ search_url }}{% querystring page=results.next_page_number %}" hx-trigger="revealed" hx-indicator="#search-page-indicator-{{ results.next_page_number }}" hx-swap="outerHTML"></span>
|
||||
<div class="icon mt-5 mx-auto htmx-indicator search-page-indicator" id="search-page-indicator-{{ results.next_page_number }}">
|
||||
<i class="fas fa-circle-notch"></i>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue