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

Method resizable

src/gridstack.ts:2256–2265  ·  view source on GitHub ↗

* Enables/Disables user resizing for specific grid elements. * For all items and future items, use enableResize() instead. No-op for static grids. * * @param els widget element(s) or selector to modify * @param val if true widget will be resizable, assuming the parent grid isn't noResize

(els: GridStackElement, val: boolean)

Source from the content-addressed store, hash-verified

2254 * grid.resizable('#fixed-size-widget', false);
2255 */
2256 public resizable(els: GridStackElement, val: boolean): GridStack {
2257 if (this.opts.staticGrid) return this; // can't resize a static grid!
2258 GridStack.getElements(els).forEach(el => {
2259 const n = el.gridstackNode;
2260 if (!n) return;
2261 val ? delete n.noResize : n.noResize = true;
2262 this.prepareDragDrop(n.el); // init DD if need be, and adjust
2263 });
2264 return this;
2265 }
2266
2267 /**
2268 * Temporarily disables widgets moving/resizing.

Callers 3

_removeDDMethod · 0.45
prepareDragDropMethod · 0.45
_onStartMovingMethod · 0.45

Calls 2

prepareDragDropMethod · 0.95
getElementsMethod · 0.45

Tested by

no test coverage detected