fix: added an early return on non-existent items (#2571)
parent
b508ac3d4f
commit
2744f7d5b9
|
@ -606,10 +606,12 @@ export default {
|
||||||
},
|
},
|
||||||
colunmsResize() {
|
colunmsResize() {
|
||||||
// Update the columns size based on the window width.
|
// Update the columns size based on the window width.
|
||||||
|
let items = css(["#listing.mosaic .item", ".mosaic#listing .item"]);
|
||||||
|
if (!items) return;
|
||||||
|
|
||||||
let columns = Math.floor(
|
let columns = Math.floor(
|
||||||
document.querySelector("main").offsetWidth / this.columnWidth
|
document.querySelector("main").offsetWidth / this.columnWidth
|
||||||
);
|
);
|
||||||
let items = css(["#listing.mosaic .item", ".mosaic#listing .item"]);
|
|
||||||
if (columns === 0) columns = 1;
|
if (columns === 0) columns = 1;
|
||||||
items.style.width = `calc(${100 / columns}% - 1em)`;
|
items.style.width = `calc(${100 / columns}% - 1em)`;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue