Merge pull request #371 from pmoradei/setgridsize_propagate
Add a parameter to setGridWidth method to allow not to propagate resi…
This commit is contained in:
commit
b3d5be137c
|
@ -415,11 +415,12 @@ Toggle the grid animation state. Toggles the `grid-stack-animate` class.
|
|||
|
||||
- `doAnimate` - if `true` the grid will animate.
|
||||
|
||||
### setGridWidth(gridWidth)
|
||||
### setGridWidth(gridWidth, doNotPropagate)
|
||||
|
||||
(Experimental) Modify number of columns in the grid. Will attempt to update existing widgets to conform to new number of columns. Requires `gridstack-extra.css` or `gridstack-extra.min.css`.
|
||||
|
||||
- `gridWidth` - Integer between 1 and 12.
|
||||
- `doNotPropagate` - if true existing widgets will not be updated.
|
||||
|
||||
### setStatic(staticValue)
|
||||
|
||||
|
|
|
@ -1538,10 +1538,13 @@
|
|||
this.grid.commit();
|
||||
};
|
||||
|
||||
GridStack.prototype.setGridWidth = function(gridWidth) {
|
||||
GridStack.prototype.setGridWidth = function(gridWidth,doNotPropagate) {
|
||||
this.container.removeClass('grid-stack-' + this.opts.width);
|
||||
if (doNotPropagate !== true) {
|
||||
this._updateNodeWidths(this.opts.width, gridWidth);
|
||||
}
|
||||
this.opts.width = gridWidth;
|
||||
this.grid.width = gridWidth;
|
||||
this.container.addClass('grid-stack-' + gridWidth);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue