Skip to content

Commit 5939813

Browse files
authored
Fix #12071. Made rowWidthGap parametric (#12072)
1 parent 77ab5a2 commit 5939813

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

web/client/plugins/Widgets.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ compose(
101101
withProps(({
102102
width,
103103
rowHeight,
104+
rowHeightGap = 20,
104105
cols,
105106
height,
106107
maximized,
@@ -116,7 +117,7 @@ compose(
116117
: height - backgroundSelectorOffset - 120;
117118
const nRows = isSingleWidgetLayout ? 1 : 4;
118119
const rowHeightRecalculated = !isSingleWidgetLayout
119-
? Math.floor(divHeight / nRows - 20)
120+
? Math.floor(divHeight / nRows - rowHeightGap)
120121
: divHeight > singleWidgetLayoutMaxHeight
121122
? singleWidgetLayoutMaxHeight
122123
: divHeight < singleWidgetLayoutMinHeight
@@ -305,6 +306,7 @@ class Widgets extends React.Component {
305306
* @prop {boolean|string|array} [toolsOptions.showHide] show the "hide tool" for the widget (the tool allows to hide the widget to users that have `seeHidden=false` ). By default is false, in the most common case it should be the same of `seeHidden`.
306307
* @prop {boolean|string|array} [toolsOptions.seeHidden] hides the widgets under particular conditions
307308
* @prop {number} cfg.rowHeight Rows have a static height
309+
* @prop {number} cfg.rowHeightGap 20 by default. Describe the margin from bottom used to calculate the rowHeight. Useful if the layout has some CSS customization
308310
* @prop {object} cfg.cols Number of columns in this layout. default is { md: 6, xxs: 1 }
309311
* @prop {object} cfg.defaults options that are used to initialize the plugin when mounted
310312
* @prop {object} cfg.defaults.initialSize new widget's default sizes in grid units. It contains 2 integers, `w` and `h`, representing the initial size of the new widget. This is useful when customizing `rowHeight` and/or `cols`, to generate a widget with a proportionated size.

0 commit comments

Comments
 (0)