File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 175175 */
176176 _detectNearestEmptySortable = function ( x , y ) {
177177 for ( var i = 0 ; i < sortables . length ; i ++ ) {
178- if ( sortables [ i ] . children . length ) continue ;
178+ if ( _lastChild ( sortables [ i ] ) ) continue ;
179179
180180 var rect = _getRect ( sortables [ i ] ) ,
181181 threshold = sortables [ i ] [ expando ] . options . emptyInsertThreshold ,
12241224 return completed ( ) ;
12251225 }
12261226
1227- if ( ( el . children . length === 0 ) || ( el . children [ 0 ] === ghostEl ) ||
1228- _ghostIsLast ( evt , axis , el ) && ! dragEl . animated
1229- ) {
1230- //assign target only if condition is true
1231- if ( el . children . length !== 0 && el . children [ 0 ] !== ghostEl && el === evt . target ) {
1232- target = _lastChild ( el ) ;
1227+ var elLastChild = _lastChild ( el ) ;
1228+
1229+ if ( ! elLastChild || _ghostIsLast ( evt , axis , el ) && ! elLastChild . animated ) {
1230+ // assign target only if condition is true
1231+ if ( elLastChild && el === evt . target ) {
1232+ target = elLastChild ;
12331233 }
12341234
12351235 if ( target ) {
19861986 function _lastChild ( el ) {
19871987 var last = el . lastElementChild ;
19881988
1989- while ( last === ghostEl || last . style . display === 'none' ) {
1989+ while ( last && ( last === ghostEl || last . style . display === 'none' ) ) {
19901990 last = last . previousElementSibling ;
1991-
1992- if ( ! last ) break ;
19931991 }
19941992
19951993 return last || null ;
You can’t perform that action at this time.
0 commit comments