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

Method setAnimation

src/gridstack.ts:1447–1458  ·  view source on GitHub ↗

* Toggle the grid animation state. Toggles the `grid-stack-animate` class. * @param doAnimate if true the grid will animate. * @param delay if true setting will be set on next event loop.

(doAnimate = this.opts.animate, delay?: boolean)

Source from the content-addressed store, hash-verified

1445 * @param delay if true setting will be set on next event loop.
1446 */
1447 public setAnimation(doAnimate = this.opts.animate, delay?: boolean): GridStack {
1448 if (delay) {
1449 // delay, but check to make sure grid (opt) is still around
1450 setTimeout(() => { if (this.opts) this.setAnimation(doAnimate) });
1451 } else if (doAnimate) {
1452 this.el.classList.add('grid-stack-animate');
1453 } else {
1454 this.el.classList.remove('grid-stack-animate');
1455 }
1456 this.opts.animate = doAnimate;
1457 return this;
1458 }
1459
1460 /** @internal */
1461 private hasAnimationCSS(): boolean { return this.el.classList.contains('grid-stack-animate') }

Callers 7

constructorMethod · 0.95
loadMethod · 0.95
destroyMethod · 0.95
updateOptionsMethod · 0.95
_setupAcceptWidgetMethod · 0.95
_keyEventMethod · 0.80
gridstack-spec.tsFile · 0.80

Calls 1

addMethod · 0.45

Tested by

no test coverage detected