@@ -41,7 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
41
41
<!-- the node value -->
42
42
<!-- TODO: revisit these values that can be replaced by constants later (and in other components too). -->
43
43
<slot name =" cyclepoint" v-if =" node.type === 'cycle'" >
44
- <div :class =" getNodeDataClass() " @click =" nodeClicked" >
44
+ <div :class =" nodeDataClass " @click =" nodeClicked" >
45
45
<!-- NOTE: cycle point nodes don't have any data associated with them
46
46
at present so we must use the root family node for the task icon.
47
47
We don't use this for the v-cylc-object as that would set the node
@@ -56,7 +56,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
56
56
</div >
57
57
</slot >
58
58
<slot name =" family-proxy" v-else-if =" node.type === 'family'" >
59
- <div :class =" getNodeDataClass() " @click =" nodeClicked" >
59
+ <div :class =" nodeDataClass " @click =" nodeClicked" >
60
60
<Task
61
61
v-cylc-object =" node"
62
62
:key =" node.id"
@@ -66,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
66
66
</div >
67
67
</slot >
68
68
<slot name =" task-proxy" v-else-if =" node.type === 'task'" >
69
- <div :class =" getNodeDataClass() " @click =" nodeClicked" >
69
+ <div :class =" nodeDataClass " @click =" nodeClicked" >
70
70
<!-- Task summary -->
71
71
<Task
72
72
v-cylc-object =" node"
@@ -89,7 +89,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
89
89
</div >
90
90
</slot >
91
91
<slot name =" job" v-else-if =" node.type === 'job'" >
92
- <div :class =" getNodeDataClass() " @click =" nodeClicked" >
92
+ <div :class =" nodeDataClass " @click =" nodeClicked" >
93
93
<Job
94
94
v-cylc-object =" node"
95
95
:key =" node.id"
@@ -184,7 +184,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
184
184
name =" node"
185
185
v-else
186
186
>
187
- <div :class =" getNodeDataClass() " >
187
+ <div :class =" nodeDataClass " >
188
188
<span
189
189
v-if =" node && node.node"
190
190
@click =" nodeClicked"
@@ -263,6 +263,9 @@ const passthroughEvents = [
263
263
' tree-item-clicked'
264
264
]
265
265
266
+ /** Margin between expand/collapse btn & node content */
267
+ const nodeContentPad = 6 // px
268
+
266
269
export default {
267
270
name: ' TreeItem' ,
268
271
@@ -383,10 +386,14 @@ export default {
383
386
expanded: this .isExpanded
384
387
}
385
388
},
389
+ nodeDataClass () {
390
+ return [' node-data' , ` node-data-${ this .node .type } ` ]
391
+ },
386
392
expandCollapseBtnStyle () {
387
393
return {
388
394
// set visibility 'hidden' to ensure element takes up space
389
- visibility: this .hasChildren ? null : ' hidden'
395
+ visibility: this .hasChildren ? null : ' hidden' ,
396
+ marginRight: ` ${ nodeContentPad} px` ,
390
397
}
391
398
},
392
399
/**
@@ -402,7 +409,7 @@ export default {
402
409
/** Make the job details triangle point to the job icon */
403
410
leafTriangleStyle () {
404
411
return {
405
- ' margin-left' : ` ${ this .nodeIndentation } px`
412
+ ' margin-left' : ` ${ this .nodeIndentation + nodeContentPad } px`
406
413
}
407
414
},
408
415
jobMessageOutputs () {
@@ -453,12 +460,6 @@ export default {
453
460
nodeClicked (e ) {
454
461
this .$emit (' tree-item-clicked' , this )
455
462
},
456
- getNodeDataClass () {
457
- const classes = {}
458
- classes[' node-data' ] = true
459
- classes[` node-data-${ this .node .type } ` ] = true
460
- return classes
461
- },
462
463
latestJob
463
464
}
464
465
}
0 commit comments