Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Commit

Permalink
fix sorting index (and therefore direction) calculation
Browse files Browse the repository at this point in the history
Refs #38
  • Loading branch information
rkusa committed Jun 5, 2015
1 parent dbf63e7 commit 35165a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions touch-dnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
}
}

this.placeholder = $('<' + tag + ' class="' + this.opts.placeholder + '" />')
this.placeholder = $('<' + tag + ' id="__ph' + this.id + '" class="' + this.opts.placeholder + '" />')

this.accept = this.index = this.direction = null
}
Expand Down Expand Up @@ -778,7 +778,7 @@
}

Sortable.prototype.indexOf = function(el) {
return this.el.find(this.opts.items).index(el)
return this.el.find(this.opts.items + ', #' + this.placeholder.attr('id')).index(el)
}

Sortable.prototype.start = function(e) {
Expand Down

0 comments on commit 35165a4

Please sign in to comment.