* Sort the nodes array from first to last, or reverse. * This is called during collision/placement operations to enforce a specific order. * * @param dir sort direction: 1 for ascending (first to last), -1 for descending (last to first) * @returns the engine instance for chaining *
(dir: 1 | -1 = 1)
| 449 | * engine.sortNodes(-1); // Sort descending |
| 450 | */ |
| 451 | public sortNodes(dir: 1 | -1 = 1): GridStackEngine { |
| 452 | this.nodes = Utils.sort(this.nodes, dir); |
| 453 | return this; |
| 454 | } |
| 455 | |
| 456 | /** @internal called to top gravity pack the items back OR revert back to original Y positions when floating */ |
| 457 | protected _packNodes(): GridStackEngine { |
no test coverage detected