Skip to content

Commit

Permalink
fix flex containers in row mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sp-kilobug committed Jul 20, 2015
1 parent 060efb5 commit 97d38ac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

lastEl,
lastCSS,
lastParentCSS,

oldIndex,
newIndex,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -760,7 +763,7 @@
this.save();
}
}

// Nulling
rootEl =
dragEl =
Expand Down Expand Up @@ -1185,7 +1188,7 @@
Sortable.create = function (el, options) {
return new Sortable(el, options);
};


// Export
Sortable.version = '1.2.2';
Expand Down

0 comments on commit 97d38ac

Please sign in to comment.