Skip to content

Commit

Permalink
Minor code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
guywillis committed Jan 14, 2025
1 parent ae7e261 commit 6c1dbe4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/HotgridView.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ class HotgridView extends ComponentView {
}

setItemWidth() {
const item = this.el.style;
item.setProperty('--adapt-hotgrid-item-width', 50 + '%');

const _columns = this.model.get('_columns');
this.el.style.setProperty('--adapt-hotgrid-item-width', 50 + '%');
if (!_columns || !device.isScreenSizeMin('medium')) return;

this.el.style.setProperty('--adapt-hotgrid-item-width', `${100 / _columns}%`);
item.setProperty('--adapt-hotgrid-item-width', `${100 / _columns}%`);
}

postRender() {
Expand Down

0 comments on commit 6c1dbe4

Please sign in to comment.