Prevents non existing view modes to be loaded in items page. Fixes padding for cards and thumbnail view modes.
This commit is contained in:
parent
fa40ac7418
commit
76b97feefe
|
@ -1134,14 +1134,28 @@
|
|||
let prefsViewMode = !this.isRepositoryLevel ? 'view_mode_' + this.collectionId : 'view_mode';
|
||||
if (this.$userPrefs.get(prefsViewMode) == undefined)
|
||||
this.$eventBusSearch.setInitialViewMode(this.defaultViewMode);
|
||||
else
|
||||
this.$eventBusSearch.setInitialViewMode(this.$userPrefs.get(prefsViewMode));
|
||||
else {
|
||||
let existingViewModeIndex = Object.keys(this.registeredViewModes).findIndex(viewMode => viewMode == this.$userPrefs.get(prefsViewMode));
|
||||
if (existingViewModeIndex >= 0)
|
||||
this.$eventBusSearch.setInitialViewMode(this.$userPrefs.get(prefsViewMode));
|
||||
else
|
||||
this.$eventBusSearch.setInitialViewMode(this.defaultViewMode);
|
||||
}
|
||||
} else {
|
||||
let prefsAdminViewMode = !this.isRepositoryLevel ? 'admin_view_mode_' + this.collectionId : 'admin_view_mode';
|
||||
if (this.$userPrefs.get(prefsAdminViewMode) == undefined)
|
||||
this.$eventBusSearch.setInitialAdminViewMode('cards');
|
||||
else
|
||||
this.$eventBusSearch.setInitialAdminViewMode(this.$userPrefs.get(prefsAdminViewMode));
|
||||
this.$eventBusSearch.setInitialAdminViewMode('table');
|
||||
else {
|
||||
let existingViewMode = this.$userPrefs.get(prefsAdminViewMode);
|
||||
if (existingViewMode == 'cards' ||
|
||||
existingViewMode == 'table' ||
|
||||
existingViewMode == 'records' ||
|
||||
existingViewMode == 'grid' ||
|
||||
existingViewMode == 'masonry')
|
||||
this.$eventBusSearch.setInitialAdminViewMode(this.$userPrefs.get(prefsAdminViewMode));
|
||||
else
|
||||
this.$eventBusSearch.setInitialAdminViewMode('table');
|
||||
}
|
||||
}
|
||||
|
||||
// Watches window resize to adjust filter's top position and compression on mobile
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
margin: 15px;
|
||||
max-width: 425px;
|
||||
min-width: 425px;
|
||||
min-height: 215px;
|
||||
max-height: 215px;
|
||||
min-height: 210px;
|
||||
max-height: 210px;
|
||||
cursor: pointer;
|
||||
|
||||
@media screen and (max-width: 480px) {
|
||||
|
@ -79,7 +79,7 @@
|
|||
}
|
||||
.metadata-title {
|
||||
flex-shrink: 0;
|
||||
padding: 0.5rem 4.75rem 0.5rem 2.75rem;
|
||||
padding: 0.6rem 4.75rem 0.5rem 2.75rem;
|
||||
margin-bottom: -27px;
|
||||
min-height: 40px;
|
||||
font-size: 0.875rem !important;
|
||||
|
|
|
@ -40,10 +40,8 @@
|
|||
opacity: 0;
|
||||
padding: 3px 8px;
|
||||
transition: visibility 0.2s, opacity 0.2s;
|
||||
margin-top: -43px;
|
||||
margin-top: -31px;
|
||||
background-color: $gray2;
|
||||
border-bottom-left-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
|
||||
a {
|
||||
margin-left: 12px;
|
||||
|
|
|
@ -132,7 +132,7 @@ export default {
|
|||
@import "../../src/admin/scss/_view-mode-cards.scss";
|
||||
|
||||
.tainacan-cards-container .tainacan-card .metadata-title {
|
||||
padding: 0.75rem;
|
||||
padding: 0.6rem 0.75rem;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -134,7 +134,7 @@ export default {
|
|||
@import "../../src/admin/scss/_view-mode-records.scss";
|
||||
|
||||
.tainacan-records-container .tainacan-record .metadata-title {
|
||||
padding: 0.75rem;
|
||||
padding: 0.6rem 0.75rem;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue