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. 9
      Sortable.js
  2. 2
      index.html

9
Sortable.js

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

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