Skip to content

Commit c309856

Browse files
committed
Add a parameter to setGridWidth method to allow not to propagate resizing to widgets.
1 parent ba1ee25 commit c309856

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/gridstack.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,10 +1417,13 @@
14171417
this.grid.commit();
14181418
};
14191419

1420-
GridStack.prototype.setGridWidth = function(gridWidth) {
1420+
GridStack.prototype.setGridWidth = function(gridWidth,doNotPropagate) {
14211421
this.container.removeClass('grid-stack-' + this.opts.width);
1422-
this._updateNodeWidths(this.opts.width, gridWidth);
1422+
if (doNotPropagate !== true) {
1423+
this._updateNodeWidths(this.opts.width, gridWidth);
1424+
}
14231425
this.opts.width = gridWidth;
1426+
this.grid.width = gridWidth;
14241427
this.container.addClass('grid-stack-' + gridWidth);
14251428
};
14261429

0 commit comments

Comments
 (0)