New attempt to fix layout issued on Masonry view modes.

This commit is contained in:
mateuswetah 2024-10-30 14:05:07 -03:00
parent 1e36e2b417
commit 14efdb3238
6 changed files with 12 additions and 13 deletions

View File

@ -10,10 +10,6 @@
#metadata-checkbox-list { #metadata-checkbox-list {
margin: 8px 12px 18px 12px; } margin: 8px 12px 18px 12px; }
#metadata-checkbox-list .components-base-control__help {
margin-left: 33px;
font-size: 0.75rem;
color: var(--tainacan-block-gray4, #505253); }
.wp-block-tainacan-item-submission-form { .wp-block-tainacan-item-submission-form {
margin: 2em auto; } margin: 2em auto; }

File diff suppressed because one or more lines are too long

View File

@ -124,7 +124,7 @@ export default {
}, },
immediate: true immediate: true
}, },
isFiltersMenuCompressed: { filtersModalStateHasChanged: {
handler() { handler() {
if (this.masonry !== false) if (this.masonry !== false)
this.masonry.layout(); this.masonry.layout();

View File

@ -177,7 +177,7 @@ export default {
}, },
immediate: true immediate: true
}, },
isFiltersMenuCompressed: { filtersModalStateHasChanged: {
handler() { handler() {
if (this.masonry !== false) if (this.masonry !== false)
this.masonry.layout(); this.masonry.layout();

View File

@ -18,9 +18,9 @@ export const viewModesMixin = {
}, },
isLoading: false, isLoading: false,
totalItems: Number, totalItems: Number,
isFiltersMenuCompressed: Boolean,
enabledViewModes: Array, enabledViewModes: Array,
containerId: String containerId: String,
filtersModalStateHasChanged: false
}, },
computed: { computed: {
queries() { queries() {

View File

@ -462,7 +462,9 @@
full-screen full-screen
:custom-class="'tainacan-modal tainacan-form filters-menu' + (filtersAsModal ? ' filters-menu-modal' : '') + (displayFiltersHorizontally ? ' horizontal-filters' : '')" :custom-class="'tainacan-modal tainacan-form filters-menu' + (filtersAsModal ? ' filters-menu-modal' : '') + (displayFiltersHorizontally ? ' horizontal-filters' : '')"
:can-cancel="hideHideFiltersButton || !filtersAsModal ? ['x', 'outside'] : ['x', 'escape', 'outside']" :can-cancel="hideHideFiltersButton || !filtersAsModal ? ['x', 'outside'] : ['x', 'escape', 'outside']"
:close-button-aria-label="$i18n.get('close')"> :close-button-aria-label="$i18n.get('close')"
@after-leave="filtersModalStateHasChanged = !filtersModalStateHasChanged"
@after-enter="filtersModalStateHasChanged = !filtersModalStateHasChanged">
<!-- JS-side hook for extra form content --> <!-- JS-side hook for extra form content -->
<div <div
@ -646,7 +648,7 @@
:displayed-metadata="displayedMetadata" :displayed-metadata="displayedMetadata"
:should-hide-items-thumbnail="hideItemsThumbnail" :should-hide-items-thumbnail="hideItemsThumbnail"
:items="items" :items="items"
:is-filters-menu-compressed="!hideFilters && !isFiltersModalActive" :filters-modal-state-has-changed="filtersModalStateHasChanged"
:total-items="totalItems" :total-items="totalItems"
:is-loading="showLoading" :is-loading="showLoading"
:enabled-view-modes="enabledViewModes" :enabled-view-modes="enabledViewModes"
@ -815,7 +817,8 @@
itemsListBottomIntersectionObserver: null, itemsListBottomIntersectionObserver: null,
latestPerPageAfterViewModeWithoutPagination: 12, latestPerPageAfterViewModeWithoutPagination: 12,
latestPageAfterViewModeWithoutPagination: 1, latestPageAfterViewModeWithoutPagination: 1,
hooks: {} hooks: {},
filtersModalStateHasChanged: false
} }
}, },
computed: { computed: {