Skip to content

Commit

Permalink
fix: added an early return on non-existent items (filebrowser#2571)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2744f7d)
  • Loading branch information
ArthurMousatov authored and langren1353 committed Jul 31, 2023
1 parent 64507a8 commit 1093c6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/views/files/Listing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,12 @@ export default {
},
colunmsResize() {
// 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(
document.querySelector("main").offsetWidth / this.columnWidth
);
let items = css(["#listing.mosaic .item", ".mosaic#listing .item"]);
if (columns === 0) columns = 1;
items.style.width = `calc(${100 / columns}% - 1em)`;
},
Expand Down

0 comments on commit 1093c6e

Please sign in to comment.