File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 185185 items = items ;
186186
187187 if (autoCompress && collision === ' compress' ) {
188- controller . compress ();
188+ _controller . _internalCompress ();
189189 }
190190 }
191191
260260 collision
261261 }));
262262
263- export const controller = new GridController ($gridSettings ) as GridControllerType ;
264- $ : controller .gridParams = $gridSettings ;
263+ const _controller = new GridController ($gridSettings );
264+ $ : _controller .gridParams = $gridSettings ;
265+
266+ export const controller = _controller as GridControllerType ;
265267
266268 setContext (GRID_CONTEXT_NAME , gridSettings );
267269 </script >
Original file line number Diff line number Diff line change @@ -33,7 +33,11 @@ export class GridController implements GridControllerType {
3333 this . _compress ( this . gridParams . items ) ;
3434 }
3535
36- private _compress ( items : Record < string , LayoutItem > ) : void {
36+ _internalCompress ( ) : void {
37+ this . _compress ( this . gridParams . items , true ) ;
38+ }
39+
40+ private _compress ( items : Record < string , LayoutItem > , skipUpdate = false ) : void {
3741 const gridItems = Object . values ( items ) ;
3842 const sortedItems = [ ...gridItems ] . sort ( ( a , b ) => a . y - b . y ) ;
3943
@@ -53,6 +57,8 @@ export class GridController implements GridControllerType {
5357 return accItem ;
5458 } , [ ] as LayoutItem [ ] ) ;
5559
56- this . gridParams . updateGrid ( ) ;
60+ if ( ! skipUpdate ) {
61+ this . gridParams . updateGrid ( ) ;
62+ }
5763 }
5864}
You can’t perform that action at this time.
0 commit comments