typescriptify album-index.js

This commit is contained in:
imperosol 2025-02-20 15:04:33 +01:00
parent c272cad2ea
commit feeff5970d
2 changed files with 4 additions and 6 deletions

View File

@ -17,12 +17,14 @@ document.addEventListener("alpine:init", () => {
page: Number.parseInt(initialUrlParams.get("page")) || 1,
pushstate: History.Push /* Used to avoid pushing a state on a back action */,
loading: false,
config: config,
async init() {
await this.fetchPictures();
this.$watch("page", () => {
updateQueryString("page", this.page === 1 ? null : this.page, this.pushstate);
this.pushstate = History.Push;
this.fetchPictures();
});
window.addEventListener("popstate", () => {

View File

@ -64,11 +64,7 @@
<br>
{% endif %}
<div x-data="pictures({
albumId: {{ album.id }},
maxPageSize: {{ settings.SITH_SAS_IMAGES_PER_PAGE }},
})">
<div x-data="pictures({ albumId: {{ album.id }}, maxPageSize: {{ settings.SITH_SAS_IMAGES_PER_PAGE }} })">
{{ download_button(_("Download album")) }}
<h4>{% trans %}Pictures{% endtrans %}</h4>
@ -94,7 +90,7 @@
</a>
</template>
</div>
{{ paginate_alpine("page", "nbPages()") }}
{{ paginate_alpine("page", "nbPages()") }}
</div>
{% if is_sas_admin %}