Skip to content

Commit 9a7df2b

Browse files
paodbjavier-godoy
authored andcommitted
fix: fix styling when direction is b2t and node template has no content
Close #41
1 parent cd1fd4d commit 9a7df2b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/main/resources/META-INF/frontend/fc-orgchart.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,20 @@ class FCOrgChart extends PolymerElement {
115115
}
116116

117117
$("div.orgchart").prev().closest("div").attr("id", "chart-container");
118-
this.querySelector(".orgchart").style.setProperty("background-image","none")
118+
this.querySelector(".orgchart").style.setProperty("background-image","none");
119+
120+
// workaround for direction b2t with node template without content div
121+
var direction = state.chartDirection;
122+
var nodeTemplate = nodeTemplate;
123+
if(direction && direction == "b2t" && nodeTemplate){
124+
this.querySelectorAll(".node").forEach(node => {
125+
var title = node.querySelector(".title");
126+
var content = node.querySelector(".content");
127+
if(title && !content){
128+
title.style.transformOrigin = "center";
129+
}
130+
});
131+
}
119132

120133
// if draggable
121134
var draggable = state.chartDraggable;

0 commit comments

Comments
 (0)