Skip to content

Commit 767318d

Browse files
committed
updated tree box width and height to better match current styling, cleaned up tree display code. Tree width is assigned at tree creation so it is difficult to dynamically adjust based on text content, so for VERY long component names the overflow-x: break-word property was added to create a new line. This will work unless someone gives a component name something incredibly long
1 parent fb7e830 commit 767318d

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/components/dashboard_items/Tree.vue

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,19 @@ Description:
1212
:config="treeConfig"
1313
ref="tree"
1414
@wheel="zoom">
15-
<template v-slot:node="{ node, collapsed }">
15+
<template v-slot:node="{ node }">
1616
<span v-if="this.activeComponent === node.value"
1717
class="tree-node-active"
18-
:style="{ border: collapsed ? '2px solid grey' : '' }"
19-
2018
>
2119
{{ node.value }}
2220
</span>
2321
<span v-else-if="this.activeRoute === node.value"
2422
class="tree-node-activeRoute"
25-
:style="{ border: collapsed ? '2px solid grey' : '' }"
26-
2723
>
2824
{{ node.value }}
2925
</span>
3026
<span v-else
3127
class="tree-node"
32-
:style="{ border: collapsed ? '2px solid grey' : '' }"
3328
@click="activateNode(node.value)"
3429
>
3530
{{ node.value }}
@@ -152,7 +147,6 @@ export default {
152147
watch: {
153148
componentMap: {
154149
handler(){
155-
console.log(this.componentMap)
156150
this.treeData = this.buildTree(this.componentMap);
157151
},
158152
deep: true,
@@ -161,7 +155,7 @@ export default {
161155
data() {
162156
return {
163157
treeData: this.buildTree(this.$store.state.componentMap),
164-
treeConfig: { nodeWidth: 120, nodeHeight: 80, levelHeight: 200},
158+
treeConfig: { nodeWidth: 175, nodeHeight: 100, levelHeight: 200},
165159
componentData: this.$store.state.componentMap,
166160
}
167161
}
@@ -181,14 +175,16 @@ export default {
181175
182176
.tree-node, .tree-node-active, .tree-node-activeRoute {
183177
display: inline-block;
184-
width: 90%;
185178
padding: 8px;
179+
min-width: 80%;
186180
margin: 6px;
187181
min-height: 28px;
188182
color: #FFFFFF;
189183
background-color: $secondary;
190184
text-align: center;
191185
line-height: 28px;
186+
border-radius: 3px;
187+
word-wrap: break-word;
192188
}
193189
194190
.tree-node-active {
@@ -198,7 +194,8 @@ export default {
198194
}
199195
200196
.tree-node-activeRoute {
201-
background-color: #155158;
197+
background-color: $accent;
198+
color: #155158;
202199
border: 2px solid rgb(196, 154, 19);
203200
}
204201

0 commit comments

Comments
 (0)