fix: draw the index tree lines at the right depth
The index tree has a single root, so its first indent unit is always marked as an end and every line was shifted one column to the right, doubling the vertical line under the root. Hide that unit and draw the node's own branch (├ or └) after the indent from the leaf-last class, as nimg.neuroinf.jp already does.
This commit is contained in:
@@ -43,26 +43,37 @@
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
width: 9px;
|
||||
background: url(../assets/images/tree_line.png);
|
||||
background: url(../assets/images/tree_line.png) no-repeat -18px 0;
|
||||
}
|
||||
.indexTree:global(.rc-tree .rc-tree-treenode .rc-tree-indent .rc-tree-indent-unit:not(:last-child)) {
|
||||
/* treeData has a single root, so the first indent unit never carries a line. */
|
||||
.indexTree:global(.rc-tree .rc-tree-treenode .rc-tree-indent .rc-tree-indent-unit:first-child) {
|
||||
display: none;
|
||||
}
|
||||
.indexTree:global(.rc-tree .rc-tree-treenode .rc-tree-indent .rc-tree-indent-unit:not(.rc-tree-indent-unit-end)) {
|
||||
background-position: -9px 0;
|
||||
}
|
||||
.indexTree:global(
|
||||
.rc-tree .rc-tree-treenode .rc-tree-indent .rc-tree-indent-unit:not(:last-child).rc-tree-indent-unit-end
|
||||
) {
|
||||
background-position: -18px 0;
|
||||
/* The node's own branch (├ or └) is drawn after the indent units. */
|
||||
.indexTree:global(.rc-tree .rc-tree-treenode .rc-tree-indent)::after {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
vertical-align: bottom;
|
||||
height: 20px;
|
||||
width: 9px;
|
||||
background: url(../assets/images/tree_line.png) no-repeat 0 0;
|
||||
}
|
||||
.indexTree:global(.rc-tree .rc-tree-treenode .rc-tree-indent .rc-tree-indent-unit:last-child.rc-tree-indent-unit-end) {
|
||||
.indexTree:global(.rc-tree .rc-tree-treenode.rc-tree-treenode-leaf-last .rc-tree-indent)::after {
|
||||
background-position: -27px 0;
|
||||
}
|
||||
.indexTree:global(.rc-tree .rc-tree-treenode:first-child .rc-tree-indent)::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.indexTree:global(.rc-tree .rc-tree-treenode .rc-tree-switcher) {
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
width: 16px;
|
||||
margin-right: 2px;
|
||||
background: url(../assets/images/tree_node.png);
|
||||
background: url(../assets/images/tree_node.png) no-repeat;
|
||||
cursor: pointer;
|
||||
}
|
||||
.indexTree:global(.rc-tree .rc-tree-treenode:first-child .rc-tree-switcher.rc-tree-switcher-noop) {
|
||||
|
||||
Reference in New Issue
Block a user