MDL-63977 Behat: Fix bug in 'near' calculation
parent
5958b9dc1b
commit
ae110772cf
|
@ -306,8 +306,9 @@
|
||||||
var calculateNearDepth = function(node) {
|
var calculateNearDepth = function(node) {
|
||||||
var depth = 0;
|
var depth = 0;
|
||||||
while (node) {
|
while (node) {
|
||||||
if (nearAncestors.indexOf(node) !== -1) {
|
var ancestorDepth = nearAncestors.indexOf(node);
|
||||||
return depth;
|
if (ancestorDepth !== -1) {
|
||||||
|
return depth + ancestorDepth;
|
||||||
}
|
}
|
||||||
node = node.parentNode;
|
node = node.parentNode;
|
||||||
depth++;
|
depth++;
|
||||||
|
|
Loading…
Reference in New Issue