Skip to content

Commit

Permalink
Merge pull request #243 from rkusa/rkusa-patch-1
Browse files Browse the repository at this point in the history
fix index calculation to skip templates
  • Loading branch information
RubaXa committed Jan 27, 2015
2 parents 0ce769b + 5325c8a commit dce3eb2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,10 @@
*/
function _index(/**HTMLElement*/el) {
var index = 0;
while (el && (el = el.previousElementSibling) && (el.nodeName.toUpperCase() !== 'TEMPLATE')) {
index++;
while (el && (el = el.previousElementSibling)) {
if (el.nodeName.toUpperCase() !== 'TEMPLATE') {
index++;
}
}
return index;
}
Expand Down

0 comments on commit dce3eb2

Please sign in to comment.