|
|
@ -335,10 +335,12 @@ |
|
|
|
var |
|
|
|
var |
|
|
|
el = this.el |
|
|
|
el = this.el |
|
|
|
, target = _closest(evt.target, this.options.draggable, el) |
|
|
|
, target = _closest(evt.target, this.options.draggable, el) |
|
|
|
|
|
|
|
, dragRect = dragEl.getBoundingClientRect() |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
if( el.children.length === 0 || el.children[0] === ghostEl || (el === evt.target) && _ghostInBottom(el, evt) ){ |
|
|
|
if( el.children.length === 0 || el.children[0] === ghostEl || (el === evt.target) && _ghostInBottom(el, evt) ){ |
|
|
|
el.appendChild(dragEl); |
|
|
|
el.appendChild(dragEl); |
|
|
|
|
|
|
|
this._animate(dragRect, dragEl); |
|
|
|
} |
|
|
|
} |
|
|
|
else if( target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0) ){ |
|
|
|
else if( target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0) ){ |
|
|
|
if( lastEl !== target ){ |
|
|
|
if( lastEl !== target ){ |
|
|
@ -347,8 +349,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dragRect = dragEl.getBoundingClientRect() |
|
|
|
var targetRect = target.getBoundingClientRect() |
|
|
|
, 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) |
|
|
@ -392,12 +393,12 @@ |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
target.offsetWidth; // repaint
|
|
|
|
target.offsetWidth; // repaint
|
|
|
|
target.animated = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_css(target, 'transition', 'transform ' + ms + 'ms'); |
|
|
|
_css(target, 'transition', 'transform ' + ms + 'ms'); |
|
|
|
_css(target, 'transform', 'translate3d(0,0,0)'); |
|
|
|
_css(target, 'transform', 'translate3d(0,0,0)'); |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(function () { |
|
|
|
clearTimeout(target.animated); |
|
|
|
|
|
|
|
target.animated = setTimeout(function () { |
|
|
|
_css(target, 'transition', ''); |
|
|
|
_css(target, 'transition', ''); |
|
|
|
target.animated = false; |
|
|
|
target.animated = false; |
|
|
|
}, ms); |
|
|
|
}, ms); |
|
|
|