Skip to content

Commit

Permalink
[#8] check for nextSib before, not after
Browse files Browse the repository at this point in the history
  • Loading branch information
timruffles committed Oct 28, 2013
1 parent 260bbda commit 333a6a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios-drag-drop.js
Expand Up @@ -166,6 +166,7 @@
// DOM helpers
function elementFromTouchEvent(el,event) {
var parent = el.parentElement;
var next = el.nextSibling
parent.removeChild(el);

var touch = event.changedTouches[0];
Expand All @@ -174,7 +175,7 @@
touch[coordinateSystemForElementFromPoint + "Y"]
);

if (next = el.nextSibling) {
if(next) {
parent.insertBefore(el, next);
} else {
parent.appendChild(el);
Expand Down

0 comments on commit 333a6a7

Please sign in to comment.