Browse Source

fix a bug causing wrapped float/flex elements to flicker when sorted

pull/662/head
Jonas Zeitler 9 years ago
parent
commit
5c426a87de
  1. 3
      Sortable.js
  2. 2
      index.html

3
Sortable.js

@ -683,6 +683,9 @@
if (elTop === tgTop) { if (elTop === tgTop) {
after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide; after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide;
}
else if (target.previousElementSibling === dragEl || dragEl.previousElementSibling === target) {
after = (evt.clientY - targetRect.top) / height > 0.5;
} else { } else {
after = tgTop > elTop; after = tgTop > elTop;
} }

2
index.html

@ -49,7 +49,7 @@
<ul id="bar" class="block__list block__list_tags"> <ul id="bar" class="block__list block__list_tags">
<li>казнить</li> <li>казнить</li>
<li>,</li> <li>,</li>
<li>нельзя</li> <li style="height: 100px; width: 280px;">нельзя</li>
<li>помиловать</li> <li>помиловать</li>
</ul> </ul>
</div> </div>

Loading…
Cancel
Save