Browse Source

Merge pull request #486 from sp-kilobug/sp-kilobug-patch-5

fix flex containers in row mode
pull/496/head
Lebedev Konstantin 10 years ago
parent
commit
8e20138f89
  1. 5
      Sortable.js

5
Sortable.js

@ -36,6 +36,7 @@
lastEl,
lastCSS,
lastParentCSS,
oldIndex,
newIndex,
@ -611,13 +612,15 @@
if (lastEl !== target) {
lastEl = target;
lastCSS = _css(target);
lastParentCSS = _css(target.parentNode);
}
var targetRect = target.getBoundingClientRect(),
width = targetRect.right - targetRect.left,
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),
isLong = (target.offsetHeight > dragEl.offsetHeight),
halfway = (floating ? (evt.clientX - targetRect.left) / width : (evt.clientY - targetRect.top) / height) > 0.5,

Loading…
Cancel
Save