* Restore all nodes back to their initial values. * This is typically called when canceling an operation (e.g., Esc key during drag). * * @returns the engine instance for chaining * * @internal
()
| 694 | * @internal |
| 695 | */ |
| 696 | public restoreInitial(): GridStackEngine { |
| 697 | this.nodes.forEach(n => { |
| 698 | if (!n._orig || Utils.samePos(n, n._orig)) return; |
| 699 | Utils.copyPos(n, n._orig); |
| 700 | n._dirty = true; |
| 701 | }); |
| 702 | this._notify(); |
| 703 | return this; |
| 704 | } |
| 705 | |
| 706 | /** |
| 707 | * Find the first available empty spot for the given node dimensions. |