Skip to content

Commit a7285cd

Browse files
committed
Fix - access hierarchy items via multiple index like folder/1/5/2
1 parent c03e47c commit a7285cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/JSRootPainter.hierarchy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,13 +763,13 @@
763763

764764
var allow_index = arg.allow_index;
765765
if ((localname[0] === '[') && (localname[localname.length-1] === ']') &&
766-
!isNaN(parseInt(localname.substr(1,localname.length-2)))) {
766+
/^\d+$/.test(localname.substr(1,localname.length-2))) {
767767
allow_index = true;
768768
localname = localname.substr(1,localname.length-2);
769769
}
770770

771771
// when search for the elements it could be allowed to check index
772-
if (allow_index) {
772+
if (allow_index && /^\d+$/.test(localname)) {
773773
var indx = parseInt(localname);
774774
if (!isNaN(indx) && (indx>=0) && (indx<top._childs.length))
775775
return process_child(top._childs[indx]);

0 commit comments

Comments
 (0)