From c1b8f207daf9cb6d87978f25b086363f27eafc92 Mon Sep 17 00:00:00 2001 From: Steve-Mcl Date: Fri, 13 Dec 2024 14:41:06 +0000 Subject: [PATCH] fix slider widths --- ui/src/layouts/Group.vue | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/ui/src/layouts/Group.vue b/ui/src/layouts/Group.vue index 1cbb597d..af0a7fa1 100644 --- a/ui/src/layouts/Group.vue +++ b/ui/src/layouts/Group.vue @@ -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 } } @@ -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', {