Skip to content

Commit 319cc7b

Browse files
author
Michael Cooper
authored
start index at 0 and get last element (#70)
1 parent 79f4fb6 commit 319cc7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

script/mapping-tables.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ function queryAll(selector, context) {
3030

3131
function getElementIndex(el) {
3232
var i = 0;
33-
do {
33+
while ((el = el.previousElementSibling)) {
3434
i++;
35-
} while ((el = el.previousElementSibling));
35+
}
3636
return i;
3737
}
3838

0 commit comments

Comments
 (0)