Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions demo/column.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</head>
<body>
<div class="container-fluid">
<h1>column() grid demo</h1>
<h1>column() grid demo (fix cellHeight)</h1>
<div><span>Number of Columns:</span> <span id="column-text">12</span></div>
<div>
<label>Choose re-layout:</label>
Expand Down Expand Up @@ -41,7 +41,11 @@ <h1>column() grid demo</h1>
</div>

<script type="text/javascript">
let grid = GridStack.init({float: true});
let grid = GridStack.init({
float: true,
disableOneColumnMode: true, // prevent auto column for this manual demo
cellHeight: 100 // fixed as default 'auto' (square) makes it hard to test 1-3 column in actual large windows tests
});
let text = document.querySelector('#column-text');
let layout = 'moveScale';

Expand Down
1 change: 1 addition & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Change log
- Dragging up and down now behave the same (used to require push WAY down past to swap/append). Also much more efficient collision code.
- handle mid point of dragged over items (>50%) rather than a new row/column and check for the most covered when multiple items collide.
- fix [1617](https://github.com/gridstack/gridstack.js/issues/1617) FireFox DOM order issue. Thanks [@marcel-necker](https://github.com/marcel-necker)
- fix changing column # `column(n)` now resizes `cellHeight:'auto'` to keep square
- add `drag | resize` events while dragging [1616](https://github.com/gridstack/gridstack.js/pull/1616). Thanks [@MrCorba](https://github.com/MrCorba)
- add `GridStack.setupDragIn()` so user can update external draggable after the grid has been created [1637](https://github.com/gridstack/gridstack.js/issues/1637)

Expand Down
3 changes: 2 additions & 1 deletion src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export class GridStack {

this._isAutoCellHeight = (this.opts.cellHeight === 'auto');
if (this._isAutoCellHeight || this.opts.cellHeight === 'initial') {
// make the cell content square initially (will use resize event to keep it square)
// make the cell content square initially (will use resize/column event to keep it square)
this.cellHeight(undefined, false);
} else {
this.cellHeight(this.opts.cellHeight, false);
Expand Down Expand Up @@ -685,6 +685,7 @@ export class GridStack {
if (!domNodes.length) { domNodes = undefined; }
}
this.engine.updateNodeWidths(oldColumn, column, domNodes, layout);
if (this._isAutoCellHeight) this.cellHeight();

// and trigger our event last...
this._ignoreLayoutsNodeChange = true; // skip layout update
Expand Down