Skip to content

Commit

Permalink
fix slider widths
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve-Mcl committed Dec 13, 2024
1 parent 1771bbe commit c1b8f20
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions ui/src/layouts/Group.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,12 @@ export default {
},
widgetStyles () {
return (widget) => {
// `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))`"
const styles = {}
const height = widget.props.height || widget.layout.height
const width = widget.props.width || widget.layout.width
if (height) {
styles['grid-row-end'] = `span ${height}`
styles['grid-template-rows'] = `repeat(${height}, minmax(var(--widget-row-height), auto))`
}
if (width) {
styles['grid-column-end'] = `span min(${this.getWidgetWidth(width)}, var(--layout-columns))`
}
styles['grid-row-end'] = `span ${height}`
styles['grid-template-rows'] = `repeat(${height}, minmax(var(--widget-row-height), auto))`
styles['grid-column-end'] = `span min(${this.getWidgetWidth(+width)}, var(--layout-columns))`
return styles
}
}
Expand Down Expand Up @@ -171,11 +166,11 @@ export default {
return style
},
getWidgetWidth (width) {
if (width) {
const w = +width // convert to number if it's a string
if (!isNaN(w) && w > 0) {
return Math.min(width, this.columns)
} else {
return this.columns
}
return this.columns
},
addSpacer () {
this.$store.dispatch('wysiwyg/addSpacer', {
Expand Down

0 comments on commit c1b8f20

Please sign in to comment.