Skip to content

Commit bed2070

Browse files
committed
remove legacy code support for disableOneColumnMode+oneColumnSize+oneColumnModeDomSort
1 parent 0e616c7 commit bed2070

File tree

2 files changed

+3
-32
lines changed

2 files changed

+3
-32
lines changed

doc/CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ Change log
126126
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
127127

128128
## 12.0.0-dev (TBD)
129-
* removed ES5 support (IE doesn't support CSS vars needed now)
129+
* [#3022](https://github.com/gridstack/gridstack.js/pull/3022) removed ES5 support (IE doesn't support CSS vars needed now)
130+
* [#3024](https://github.com/gridstack/gridstack.js/pull/3024) remove legacy code support for disableOneColumnMode, oneColumnSize, oneColumnModeDomSort
130131

131132
## 12.0.0 (2025-04-12)
132133
* feat: [#2854](https://github.com/gridstack/gridstack.js/pull/2854) Removed dynamic stylesheet and migrated to CSS vars. Thank you [lmartorella](https://github.com/lmartorella)

src/gridstack.ts

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,6 @@ interface InternalGridStackOptions extends GridStackOptions {
5656
_alwaysShowResizeHandle?: true | false | 'mobile'; // so we can restore for save
5757
}
5858

59-
// temporary legacy (<10.x) support
60-
interface OldOneColumnOpts extends GridStackOptions {
61-
/** disables the onColumnMode when the grid width is less (default?: false) */
62-
disableOneColumnMode?: boolean;
63-
/** minimal width before grid will be shown in one column mode (default?: 768) */
64-
oneColumnSize?: number;
65-
/** set to true if you want oneColumnMode to use the DOM order and ignore x,y from normal multi column
66-
layouts during sorting. This enables you to have custom 1 column layout that differ from the rest. (default?: false) */
67-
oneColumnModeDomSort?: boolean;
68-
}
69-
7059
/**
7160
* Main gridstack class - you will need to call `GridStack.init()` first to initialize your grid.
7261
* Note: your grid elements MUST have the following classes for the CSS layout to work:
@@ -284,26 +273,7 @@ export class GridStack {
284273
if (opts.alwaysShowResizeHandle !== undefined) {
285274
(opts as InternalGridStackOptions)._alwaysShowResizeHandle = opts.alwaysShowResizeHandle;
286275
}
287-
let bk = opts.columnOpts?.breakpoints;
288-
// LEGACY: oneColumnMode stuff changed in v10.x - check if user explicitly set something to convert over
289-
const oldOpts: OldOneColumnOpts = opts;
290-
if (oldOpts.oneColumnModeDomSort) {
291-
delete oldOpts.oneColumnModeDomSort;
292-
console.log('warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.')
293-
}
294-
if (oldOpts.oneColumnSize || oldOpts.disableOneColumnMode === false) {
295-
const oneSize = oldOpts.oneColumnSize || 768;
296-
delete oldOpts.oneColumnSize;
297-
delete oldOpts.disableOneColumnMode;
298-
opts.columnOpts = opts.columnOpts || {};
299-
bk = opts.columnOpts.breakpoints = opts.columnOpts.breakpoints || [];
300-
let oneColumn = bk.find(b => b.c === 1);
301-
if (!oneColumn) {
302-
oneColumn = { c: 1, w: oneSize };
303-
bk.push(oneColumn, { c: 12, w: oneSize + 1 });
304-
} else oneColumn.w = oneSize;
305-
}
306-
//...end LEGACY
276+
307277
// cleanup responsive opts (must have columnWidth | breakpoints) then sort breakpoints by size (so we can match during resize)
308278
const resp = opts.columnOpts;
309279
if (resp) {

0 commit comments

Comments
 (0)