* Check if a widget should resize to fit its content. * * @param n the grid node to check (can be undefined) * @param strict if true, only returns true for explicit sizeToContent:true (not numbers) * @returns true if the widget should resize to content * * @example * if (Utils.s
(n: GridStackNode | undefined, strict = false)
| 223 | * } |
| 224 | */ |
| 225 | static shouldSizeToContent(n: GridStackNode | undefined, strict = false): boolean { |
| 226 | return n?.grid && (strict ? |
| 227 | (n.sizeToContent === true || (n.grid.opts.sizeToContent === true && n.sizeToContent === undefined)) : |
| 228 | (!!n.sizeToContent || (n.grid.opts.sizeToContent && n.sizeToContent !== false))); |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * Check if two grid positions overlap/intersect. |
no outgoing calls
no test coverage detected