Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fead8d3

Browse files
Merge pull request gridstack#3045 from adumesny/master
fix `opts.animate` again
2 parents 3517210 + c83bd55 commit fead8d3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

‎doc/CHANGES.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ Change log
126126

127127
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
128128

129+
## 12.1.1-dev (TBD)
130+
* fix [#3043](https://github.com/gridstack/gridstack.js/issues/3043) fix `opts.animate` again
131+
132+
129133
## 12.1.1 (2024年04月28日)
130134
* fix [#3038](https://github.com/gridstack/gridstack.js/pull/3038) `updateOptions()` fix opts.minRow being undefined
131135

‎src/gridstack.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import { DDGridStack } from './dd-gridstack';
2424
import { isTouch } from './dd-touch';
2525
import { DDManager } from './dd-manager';
26-
import { DDElementHost } from './dd-element';/** global instance */
26+
import { DDElementHost } from './dd-element';/** global instance */
2727
const dd = new DDGridStack;
2828

2929
// export all dependent file as well to make it easier for users to just import the main file
@@ -704,7 +704,8 @@ export class GridStack {
704704

705705
// if we are loading from empty temporarily remove animation
706706
const blank = !this.engine.nodes.length;
707-
if (blank) this.setAnimation(false);
707+
const noAnim = blank && this.opts.animate;
708+
if (noAnim) this.setAnimation(false);
708709

709710
// see if any items are missing from new layout and need to be removed first
710711
if (!blank && addRemove) {
@@ -769,8 +770,7 @@ export class GridStack {
769770
delete this._ignoreLayoutsNodeChange;
770771
delete this.engine.skipCacheUpdate;
771772
prevCB ? GridStack.addRemoveCB = prevCB : delete GridStack.addRemoveCB;
772-
// delay adding animation back
773-
if (blank && this.opts?.animate) this.setAnimation(this.opts.animate, true);
773+
if (noAnim) this.setAnimation(true, true); // delay adding animation back
774774
return this;
775775
}
776776

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /