@bbn/bbn 1.0.412 → 1.0.413
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/fn/html/getPath.js +4 -7
- package/package.json +1 -1
package/dist/fn/html/getPath.js
CHANGED
|
@@ -25,19 +25,13 @@ export default function getPath(element) {
|
|
|
25
25
|
path = '#' + realNode.id + '>' + path;
|
|
26
26
|
done = 1;
|
|
27
27
|
}
|
|
28
|
-
if (!done) {
|
|
29
|
-
if (realNode.className && realNode.className !== ' ') {
|
|
30
|
-
name_1 += '.' + replaceAll(' ', '.', replaceAll(' ', ' ', realNode.className));
|
|
31
|
-
}
|
|
32
|
-
done = 1;
|
|
33
|
-
}
|
|
34
28
|
//var parent = node.parent(),
|
|
35
29
|
var parent_1 = node.parentNode,
|
|
36
30
|
//sameTagSiblings = parent.children(name);
|
|
37
31
|
sameTagSiblings = Array.from(parent_1.children).filter(function (val) {
|
|
38
32
|
return val.tagName === name_1;
|
|
39
33
|
});
|
|
40
|
-
if (sameTagSiblings.length > 1) {
|
|
34
|
+
if (!done && sameTagSiblings.length > 1) {
|
|
41
35
|
//var allSiblings = parent.children(),
|
|
42
36
|
var allSiblings = Array.from(parent_1.children),
|
|
43
37
|
//index = allSiblings.index(realNode) + 1;
|
|
@@ -46,6 +40,9 @@ export default function getPath(element) {
|
|
|
46
40
|
name_1 += ':nth-child(' + index + ')';
|
|
47
41
|
}
|
|
48
42
|
}
|
|
43
|
+
else if (realNode.className && realNode.className !== ' ') {
|
|
44
|
+
name_1 += '.' + replaceAll(' ', '.', replaceAll(' ', ' ', realNode.className));
|
|
45
|
+
}
|
|
49
46
|
path = name_1 + (path ? '>' + path : '');
|
|
50
47
|
node = parent_1;
|
|
51
48
|
};
|