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

Method enableMove

src/gridstack.ts:2342–2350  ·  view source on GitHub ↗

* Enables/disables widget moving for all widgets. No-op for static grids. * Note: locally defined items (with noMove property) still override this setting. * * @param doEnable if true widgets will be movable, if false moving is disabled * @param recurse if true (default), sub-grids also

(doEnable: boolean, recurse = true)

Source from the content-addressed store, hash-verified

2340 * grid.enableMove(true, false);
2341 */
2342 public enableMove(doEnable: boolean, recurse = true): GridStack {
2343 if (this.opts.staticGrid) return this; // can't move a static grid!
2344 doEnable ? delete this.opts.disableDrag : this.opts.disableDrag = true; // FIRST before we update children as grid overrides #1658
2345 this.engine.nodes.forEach(n => {
2346 this.prepareDragDrop(n.el);
2347 if (n.subGrid && recurse) n.subGrid.enableMove(doEnable, recurse);
2348 });
2349 return this;
2350 }
2351
2352 /**
2353 * Enables/disables widget resizing for all widgets. No-op for static grids.

Callers 4

updateOptionsMethod · 0.95
disableMethod · 0.95
enableMethod · 0.95
gridstack-spec.tsFile · 0.80

Calls 1

prepareDragDropMethod · 0.95

Tested by

no test coverage detected