MCPcopy Index your code
hub / github.com/gridstack/gridstack.js / saveInitial

Method saveInitial

src/gridstack-engine.ts:679–686  ·  view source on GitHub ↗

* Save the initial position/size of all nodes to track real dirty state. * This creates a snapshot of current positions that can be restored later. * * Note: Should be called right after change events and before move/resize operations. * * @returns the engine instance for chaining

()

Source from the content-addressed store, hash-verified

677 * @internal
678 */
679 public saveInitial(): GridStackEngine {
680 this.nodes.forEach(n => {
681 n._orig = Utils.copyPos({}, n);
682 delete n._dirty;
683 });
684 this._hasLocked = this.nodes.some(n => n.locked);
685 return this;
686 }
687
688 /**
689 * Restore all nodes back to their initial values.

Callers 3

batchUpdateMethod · 0.95
beginUpdateMethod · 0.95
_triggerChangeEventMethod · 0.80

Calls 1

copyPosMethod · 0.80

Tested by

no test coverage detected