Skip to content

Commit 42a256e

Browse files
Correct missing diagram menu links
Signed-off-by: Richard Marston <rmarston@eonerc.rwth-aachen.de>
1 parent 30bee6f commit 42a256e

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

cimmenu/src/cimmenu.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,12 @@ class cimmenu {
207207
}
208208

209209
populateDiagramComponents() {
210-
this.reactMenu.updateDiagramMenuLinks(this.templateJson["Diagram"]);
211-
this.reactMenu.updateDiagramMenuLinks(this.templateJson["CoordinateSystem"]);
210+
if (Object.keys(this.templateJson["Diagram"]).length > 0) {
211+
this.reactMenu.updateDiagramMenuLinks(this.templateJson["Diagram"]);
212+
}
213+
if (Object.keys(this.templateJson["CoordinateSystem"]).length > 0) {
214+
this.reactMenu.updateDiagramMenuLinks(this.templateJson["CoordinateSystem"]);
215+
}
212216
}
213217

214218
static populatePanelWithData(panelNode, menuItems, titleText) {

cimsvg/src/cimsvg.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,20 @@ class cimsvg {
5858
hideSvg() {
5959
this.svgNode.classList.add("nopointer");
6060
for (let childNode in this.svgNode.childNodes) {
61-
console.log(this.svgNode.childNodes[childNode])
6261
if (this.svgNode.childNodes[childNode].nodeType === Node.ELEMENT_NODE)
63-
this.svgNode.childNodes[childNode].classList.add("nodisplay");
62+
{
63+
this.svgNode.childNodes[childNode].classList.add("nodisplay");
64+
}
6465
}
6566
}
6667

6768
showSvg() {
6869
this.svgNode.classList.remove("nopointer");
6970
for (let childNode in this.svgNode.childNodes) {
70-
console.log(this.svgNode.childNodes[childNode])
71-
this.svgNode.childNodes[childNode].classList.remove("nodisplay");
71+
if (this.svgNode.childNodes[childNode].nodeType === Node.ELEMENT_NODE)
72+
{
73+
this.svgNode.childNodes[childNode].classList.remove("nodisplay");
74+
}
7275
}
7376
}
7477

0 commit comments

Comments
 (0)