Skip to content

Commit

Permalink
Fix column sizing issue for widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
joepavitt committed Nov 4, 2024
1 parent fc3bde9 commit de76e2e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ui/src/layouts/Group.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class="nrdb-ui-widget"
:class="getWidgetClass(w)"
style="display: grid"
:style="`grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(${w.props.height}, minmax(var(--widget-row-height), auto)); grid-row-end: span ${w.props.height}; grid-column-end: span min(${ w.props.width || columns }, var(--layout-columns))`"
:style="`grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(${w.props.height}, minmax(var(--widget-row-height), auto)); grid-row-end: span ${w.props.height}; grid-column-end: span min(${ getWidgetWidth(w.props.width) }, var(--layout-columns))`"
>
<component :is="w.component" :id="w.id" :props="w.props" :state="w.state" :style="`grid-row-end: span ${w.props.height}`" />
</div>
Expand Down Expand Up @@ -70,6 +70,13 @@ export default {
classes.push(widget.state.class)
}
return classes.join(' ')
},
getWidgetWidth (width) {
if (width) {
return Math.min(width, this.columns)
} else {
return this.columns
}
}
}
}
Expand Down

0 comments on commit de76e2e

Please sign in to comment.