File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 33 var Utils = {
44 is_intercepted : function ( a , b ) {
55 return ! ( a . x + a . width <= b . x || b . x + b . width <= a . x || a . y + a . height <= b . y || b . y + b . height <= a . y ) ;
6+ } ,
7+
8+ sort : function ( nodes , dir , width ) {
9+ width = width || _ . chain ( nodes ) . map ( function ( node ) { return node . x + node . width ; } ) . max ( ) . value ( ) ;
10+ dir = dir != - 1 ? 1 : - 1 ;
11+ return _ . sortBy ( nodes , function ( n ) { return dir * ( n . x + n . y * width ) ; } ) ;
612 }
713 } ;
814
3238 } ;
3339
3440 GridStackEngine . prototype . _sort_nodes = function ( dir ) {
35- dir = dir != - 1 ? 1 : - 1 ;
36- this . nodes = _ . sortBy ( this . nodes , function ( n ) { return dir * ( n . x + n . y * this . width ) ; } , this ) ;
41+ this . nodes = Utils . sort ( this . nodes , dir , this . width ) ;
3742 } ;
3843
3944 GridStackEngine . prototype . _pack_nodes = function ( ) {
You can’t perform that action at this time.
0 commit comments