@@ -23,7 +23,7 @@ import {
23
23
import { DDGridStack } from './dd-gridstack' ;
24
24
import { isTouch } from './dd-touch' ;
25
25
import { DDManager } from './dd-manager' ;
26
- import { DDElementHost } from './dd-element' ; /** global instance */
26
+ import { DDElementHost } from './dd-element' ; /** global instance */
27
27
const dd = new DDGridStack ;
28
28
29
29
// 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 {
704
704
705
705
// if we are loading from empty temporarily remove animation
706
706
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 ) ;
708
709
709
710
// see if any items are missing from new layout and need to be removed first
710
711
if ( ! blank && addRemove ) {
@@ -769,8 +770,7 @@ export class GridStack {
769
770
delete this . _ignoreLayoutsNodeChange ;
770
771
delete this . engine . skipCacheUpdate ;
771
772
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
774
774
return this ;
775
775
}
776
776
0 commit comments