Fixed #4458 - Paginator: Responsive Templating showing multiple layouts on break points
parent
a1992e475f
commit
fbec81fa8d
|
@ -160,7 +160,15 @@ export default {
|
|||
});
|
||||
|
||||
for (const [index, [key]] of Object.entries(Object.entries(sortedBreakpoints))) {
|
||||
const minValue = Object.entries(sortedBreakpoints)[index - 1] ? `and (min-width:${Object.keys(sortedBreakpoints)[index - 1]})` : '';
|
||||
let minValue, calculatedMinValue;
|
||||
|
||||
if (key !== 'default' && typeof Object.keys(sortedBreakpoints)[index - 1] === 'string') {
|
||||
calculatedMinValue = Number(Object.keys(sortedBreakpoints)[index - 1].slice(0, -2)) + 1 + 'px';
|
||||
} else {
|
||||
calculatedMinValue = Object.keys(sortedBreakpoints)[index - 1];
|
||||
}
|
||||
|
||||
minValue = Object.entries(sortedBreakpoints)[index - 1] ? `and (min-width:${calculatedMinValue})` : '';
|
||||
|
||||
if (key === 'default') {
|
||||
innerHTML += `
|
||||
|
@ -173,10 +181,10 @@ export default {
|
|||
`;
|
||||
} else {
|
||||
innerHTML += `
|
||||
.paginator[${this.attributeSelector}], .p-paginator-${key} {
|
||||
.paginator[${this.attributeSelector}], .p-paginator-${key} {
|
||||
display: none !important;
|
||||
}
|
||||
@media screen ${minValue} and (max-width: ${key}) {
|
||||
}
|
||||
@media screen ${minValue} and (max-width: ${key}) {
|
||||
.paginator[${this.attributeSelector}], .p-paginator-${key} {
|
||||
display: flex !important;
|
||||
}
|
||||
|
@ -184,7 +192,7 @@ export default {
|
|||
.p-paginator-default{
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue