* 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)
| 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. |
no test coverage detected