pagination: added cancel button to the dialog
Some checks failed
/ push (push) Has been cancelled

This commit is contained in:
Tigor Hutasuhut 2024-05-13 15:52:41 +07:00
parent 5b1429c1a2
commit f98bed2e69

View file

@ -135,7 +135,9 @@ templ Pagination(c *views.Context, data PaginationData) {
} }
</div> </div>
<dialog <dialog
onclick="if (event.target === this) this.close()" onclick="if (event.target === this && window.matchMedia('(max-width: 600px)').matches) {
this.close()
}"
x-ref="dialog" x-ref="dialog"
class="modal" class="modal"
> >
@ -161,6 +163,7 @@ templ Pagination(c *views.Context, data PaginationData) {
hx-trigger="custom" hx-trigger="custom"
@keyup.enter="htmx.trigger($el, 'custom')" @keyup.enter="htmx.trigger($el, 'custom')"
:hx-vals="vals" :hx-vals="vals"
onfocus="this.select()"
/> />
<button <button
hx-get={ c.Request.URL.Path } hx-get={ c.Request.URL.Path }
@ -174,6 +177,9 @@ templ Pagination(c *views.Context, data PaginationData) {
class="btn btn-primary join-item" class="btn btn-primary join-item"
>Go</button> >Go</button>
</div> </div>
<div class="mt-4 grid justify-center">
<button type="button" @click="$refs.dialog.close()" class="btn btn-secondary mx-auto">Cancel</button>
</div>
</div> </div>
</dialog> </dialog>
</div> </div>