|
|
@ -36,6 +36,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
lastEl, |
|
|
|
lastEl, |
|
|
|
lastCSS, |
|
|
|
lastCSS, |
|
|
|
|
|
|
|
lastParentCSS, |
|
|
|
|
|
|
|
|
|
|
|
oldIndex, |
|
|
|
oldIndex, |
|
|
|
newIndex, |
|
|
|
newIndex, |
|
|
@ -611,13 +612,15 @@ |
|
|
|
if (lastEl !== target) { |
|
|
|
if (lastEl !== target) { |
|
|
|
lastEl = target; |
|
|
|
lastEl = target; |
|
|
|
lastCSS = _css(target); |
|
|
|
lastCSS = _css(target); |
|
|
|
|
|
|
|
lastParentCSS = _css(target.parentNode); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var targetRect = target.getBoundingClientRect(), |
|
|
|
var targetRect = target.getBoundingClientRect(), |
|
|
|
width = targetRect.right - targetRect.left, |
|
|
|
width = targetRect.right - targetRect.left, |
|
|
|
height = targetRect.bottom - targetRect.top, |
|
|
|
height = targetRect.bottom - targetRect.top, |
|
|
|
floating = /left|right|inline/.test(lastCSS.cssFloat + lastCSS.display), |
|
|
|
floating = /left|right|inline/.test(lastCSS.cssFloat + lastCSS.display) |
|
|
|
|
|
|
|
|| (lastParentCSS.display == 'flex' && lastParentCSS['flex-direction'].indexOf('row') === 0), |
|
|
|
isWide = (target.offsetWidth > dragEl.offsetWidth), |
|
|
|
isWide = (target.offsetWidth > dragEl.offsetWidth), |
|
|
|
isLong = (target.offsetHeight > dragEl.offsetHeight), |
|
|
|
isLong = (target.offsetHeight > dragEl.offsetHeight), |
|
|
|
halfway = (floating ? (evt.clientX - targetRect.left) / width : (evt.clientY - targetRect.top) / height) > 0.5, |
|
|
|
halfway = (floating ? (evt.clientX - targetRect.left) / width : (evt.clientY - targetRect.top) / height) > 0.5, |
|
|
@ -760,7 +763,7 @@ |
|
|
|
this.save(); |
|
|
|
this.save(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Nulling
|
|
|
|
// Nulling
|
|
|
|
rootEl = |
|
|
|
rootEl = |
|
|
|
dragEl = |
|
|
|
dragEl = |
|
|
@ -1185,7 +1188,7 @@ |
|
|
|
Sortable.create = function (el, options) { |
|
|
|
Sortable.create = function (el, options) { |
|
|
|
return new Sortable(el, options); |
|
|
|
return new Sortable(el, options); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Export
|
|
|
|
// Export
|
|
|
|
Sortable.version = '1.2.2'; |
|
|
|
Sortable.version = '1.2.2'; |
|
|
|