Fix wishlist view switching back to grid

This commit is contained in:
grandeljay 2022-11-25 14:02:56 +01:00
parent 8afd41adc4
commit 8d1ed9adc4

View file

@ -36,12 +36,14 @@ $(function () {
}
/** Set wishlist style */
const orientationIsPortrait = window.matchMedia('(orientation: portrait)');
if ($('.buttons.view .active.button[value]').length === 0) {
const orientationIsPortrait = window.matchMedia('(orientation: portrait)');
if (orientationIsPortrait.matches) {
$('.buttons.view .button[value="list"]').trigger('click');
} else {
$('.buttons.view .button[value="grid"]').trigger('click');
if (orientationIsPortrait.matches) {
$('.buttons.view .button[value="list"]').trigger('click');
} else {
$('.buttons.view .button[value="grid"]').trigger('click');
}
}
},
};