Skip to content

Commit

Permalink
'#1773 adds missing CSS and JS. Calls method to open tree nodes only
Browse files Browse the repository at this point in the history
when the page has declared an window.containsNavigableTree boolean
variable with true value to avoid unnecessary code execution.
  • Loading branch information
patrickdalla committed Oct 25, 2024
1 parent e0b12b6 commit 4bf3fd1
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
summary {
cursor: pointer;
outline: 0;
}


details {
white-space: nowrap;
}
details details {
margin-left: 1.4rem;
}
details li {
margin-left: 1.4rem;
}
details a {
margin-left: 1.4rem;
}

details[open] > details::before {
transform: rotate(90deg);
}
.uuidlink {
cursor: pointer;
}
.uuidlink::-webkit-details-marker{
display: none;
}
.uuidlink::marker {
content: "";
}

summary > details {
padding-left: 1.4rem;
}
summary.nochild::-webkit-details-marker{
display: none;
}
summary.nochild::marker {
content: "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function clickUUID() {
const source = event.target || event.srcElement;
window.app.open('bplist\\:embeddedID:"'+source.getAttribute("uuid")+'"');
}

window.containsNavigableTree=true;

Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,20 @@ protected void highlightNode(Node node, boolean parentVisible) {
}
}

// expands all parent elements of each hit
for (int i = 0; i < totalHits; i++) {
webEngine.executeScript("var a = document.getElementById(\"indexerHit-" + i + "\");\n" + "var els = [];\n" + "while (a) {\n" + " a.open = 'true';\n"
+ " a = a.parentNode;\n" + "}"); //$NON-NLS-2$
if (totalHits > 0) {
// expands all parent elements of each hit
try {
Boolean isNavigableTree = (Boolean) webEngine.executeScript("window.containsNavigableTree");
if (isNavigableTree.booleanValue()) {
for (int i = 0; i < totalHits; i++) {
webEngine.executeScript("var a = document.getElementById(\"indexerHit-" + i + "\");\n" + "var els = [];\n" + "while (a) {\n" + " a.open = 'true';\n"
+ " a = a.parentNode;\n" + "}"); //$NON-NLS-2$
}
}
} catch (ClassCastException e) {
// ignores as the value is not of required type
}
}

}
} while (term != null);

Expand Down

0 comments on commit 4bf3fd1

Please sign in to comment.