Fixes to items list perpage and link reference.

This commit is contained in:
mateuswetah 2024-07-01 12:20:37 -03:00
parent 27766c5ff7
commit b9cf084690
4 changed files with 14 additions and 9 deletions

View File

@ -44,7 +44,7 @@
@media screen and (max-width: 768px) {
&:not(.filters-menu-modal) {
&.modal:not(.filters-menu-modal) {
.modal-content {
background-color: var(--tainacan-background-color);
margin: 0 12% 0 0;

View File

@ -82,8 +82,8 @@ export const viewModesMixin = {
// Inserts information necessary for item by item navigation on single pages
this.queries['pos'] = ((this.queries['paged'] - 1) * this.queries['perpage']) + index;
this.queries['source_list'] = this.termId ? 'term' : (!this.collectionId || this.collectionId == 'default' ? 'repository' : 'collection');
if ( this.$route && this.$route.path )
this.queries['ref'] = this.$route.path;
if ( this.$route && this.$route.href && this.$route.href.split('?') && this.$route.href.split('?').length )
this.queries['ref'] = this.$route.href;
return itemUrl + '?' + qs.stringify(this.queries);
}
return itemUrl;

View File

@ -215,13 +215,17 @@
@media screen and (max-width: 768px) {
&.is-filters-menu-open {
.items-list-area {
max-width: 100%;
}
.filters-menu {
float: none;
max-width: 100%;
}
.items-list-area {
width: 100%;
max-width: 100%;
}
.filters-menu {

View File

@ -1078,6 +1078,12 @@
}
}
// If any default items per page is set, apply it
// 12 is already the default value, se we don't set this value
if (this.defaultItemsPerPage != undefined && this.defaultItemsPerPage !== 12 ) {
this.$eventBusSearch.setItemsPerPage(this.defaultItemsPerPage, true);
}
for (let key in currentQuery) {
if (currentQuery[key] == 'true')
currentQuery[key] = true;
@ -1172,11 +1178,6 @@
this.$eventBusSearch.setItemsPerPage(24, true);
}
}
// If any default items per page is set, apply it
if (this.defaultItemsPerPage)
this.$eventBusSearch.setItemsPerPage(this.defaultItemsPerPage, true);
// Watches window resize to adjust filter's top position and compression on mobile
if ( !this.hideFilters && !this.shouldNotHideFiltersOnMobile ) {