Skip to content

Commit

Permalink
fix index calculation to skip templates
Browse files Browse the repository at this point in the history
  • Loading branch information
rkusa committed Jan 27, 2015
1 parent 0ce769b commit 5325c8a
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 5325c8a

Please sign in to comment.