Skip to content

Commit a9d6120

Browse files
authored
Merge pull request #90 from oslabs-beta/master
html elements tab fix
2 parents 6771a50 + 6099a79 commit a9d6120

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

src/components/HomeQueue.vue

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Description:
77
<template>
88
<section class="home-queue">
99
<i v-if='this.activeLayer.id !== ""' class="fas fa fa-chevron-up fa-md" @click="setParentLayer"></i>
10-
<span class='list-title' v-if='this.activeLayer.id !== ""'> Viewing Elements in '{{ this.activeComponent }} {{ this.depth }}' </span>
10+
<span class='list-title' v-if='this.activeLayer.id !== ""'> Viewing Elements in '{{ this.activeComponent }} {{ depth }}' </span>
1111
<span class='list-title' v-else-if='this.activeComponent !==""'> Viewing Elements in '{{ this.activeComponent }}' </span>
1212
<span class='list-title' v-else> Elements in Queue </span>
1313
<hr>
@@ -49,7 +49,6 @@ export default {
4949
},
5050
data () {
5151
return {
52-
depth: '',
5352
exceptions: ['input', 'img', 'link']
5453
}
5554
},
@@ -74,7 +73,15 @@ export default {
7473
set (value) {
7574
this.$store.dispatch(setSelectedElementList, value)
7675
}
76+
},
77+
depth: function () {
78+
let newTitle = ''
79+
this.activeLayer.lineage.forEach(el => {
80+
newTitle += ` > ${el}`
81+
})
82+
return newTitle
7783
}
84+
7885
},
7986
methods: {
8087
...mapActions(['setActiveHTML', 'setActiveLayer', 'upOneLayer']),
@@ -89,20 +96,11 @@ export default {
8996
},
9097
setLayer (element) {
9198
this.setActiveLayer(element)
92-
this.setTitle()
9399
},
94100
setParentLayer () {
95101
if (this.activeLayer.id !== '') {
96102
this.upOneLayer(this.activeLayer.id)
97-
this.setTitle()
98103
}
99-
},
100-
setTitle () {
101-
let newTitle = ''
102-
this.activeLayer.lineage.forEach(el => {
103-
newTitle += ` > ${el}`
104-
})
105-
this.depth = newTitle
106104
}
107105
},
108106
watch: {
@@ -113,12 +111,6 @@ export default {
113111
} else {
114112
this.component = false
115113
}
116-
},
117-
activeLayer: function () {
118-
// console.log('watching activeComponent in HomeQueue')
119-
if (this.activeLayer !== '') {
120-
this.setTitle()
121-
}
122114
}
123115
}
124116
}

0 commit comments

Comments
 (0)