@@ -35,7 +35,7 @@ import {
35
35
scrollBy ,
36
36
clone ,
37
37
expando ,
38
- getContentRect
38
+ getChildContainingRectFromElement
39
39
} from './utils.js' ;
40
40
41
41
@@ -1790,22 +1790,22 @@ function _unsilent() {
1790
1790
1791
1791
function _ghostIsFirst ( evt , vertical , sortable ) {
1792
1792
let firstElRect = getRect ( getChild ( sortable . el , 0 , sortable . options , true ) ) ;
1793
- const sortableContentRect = getContentRect ( sortable . el ) ;
1793
+ const childContainingRect = getChildContainingRectFromElement ( sortable . el , sortable . options , ghostEl ) ;
1794
1794
const spacer = 10 ;
1795
1795
1796
1796
return vertical ?
1797
- ( evt . clientX < sortableContentRect . left - spacer || evt . clientY < firstElRect . top && evt . clientX < firstElRect . right ) :
1798
- ( evt . clientY < sortableContentRect . top - spacer || evt . clientY < firstElRect . bottom && evt . clientX < firstElRect . left )
1797
+ ( evt . clientX < childContainingRect . left - spacer || evt . clientY < firstElRect . top && evt . clientX < firstElRect . right ) :
1798
+ ( evt . clientY < childContainingRect . top - spacer || evt . clientY < firstElRect . bottom && evt . clientX < firstElRect . left )
1799
1799
}
1800
1800
1801
1801
function _ghostIsLast ( evt , vertical , sortable ) {
1802
1802
const lastElRect = getRect ( lastChild ( sortable . el , sortable . options . draggable ) ) ;
1803
- const sortableContentRect = getContentRect ( sortable . el ) ;
1803
+ const childContainingRect = getChildContainingRectFromElement ( sortable . el , sortable . options , ghostEl ) ;
1804
1804
const spacer = 10 ;
1805
1805
1806
1806
return vertical ?
1807
- ( evt . clientX > sortableContentRect . right + spacer || evt . clientY > lastElRect . bottom && evt . clientX > lastElRect . left ) :
1808
- ( evt . clientY > sortableContentRect . bottom + spacer || evt . clientX > lastElRect . right && evt . clientY > lastElRect . top ) ;
1807
+ ( evt . clientX > childContainingRect . right + spacer || evt . clientY > lastElRect . bottom && evt . clientX > lastElRect . left ) :
1808
+ ( evt . clientY > childContainingRect . bottom + spacer || evt . clientX > lastElRect . right && evt . clientY > lastElRect . top ) ;
1809
1809
}
1810
1810
1811
1811
function _getSwapDirection ( evt , target , targetRect , vertical , swapThreshold , invertedSwapThreshold , invertSwap , isLastTarget ) {
@@ -1944,23 +1944,23 @@ if (documentExists) {
1944
1944
1945
1945
// Export utils
1946
1946
Sortable . utils = {
1947
- on : on ,
1948
- off : off ,
1949
- css : css ,
1950
- find : find ,
1947
+ on,
1948
+ off,
1949
+ css,
1950
+ find,
1951
1951
is : function ( el , selector ) {
1952
1952
return ! ! closest ( el , selector , el , false ) ;
1953
1953
} ,
1954
- extend : extend ,
1955
- throttle : throttle ,
1956
- closest : closest ,
1957
- toggleClass : toggleClass ,
1958
- clone : clone ,
1959
- index : index ,
1954
+ extend,
1955
+ throttle,
1956
+ closest,
1957
+ toggleClass,
1958
+ clone,
1959
+ index,
1960
1960
nextTick : _nextTick ,
1961
1961
cancelNextTick : _cancelNextTick ,
1962
1962
detectDirection : _detectDirection ,
1963
- getChild : getChild
1963
+ getChild
1964
1964
} ;
1965
1965
1966
1966
0 commit comments