Skip to content

Commit e9e6e1a

Browse files
committed
commtting edit layer
co-authored by: Faraz Moallemi [email protected]
1 parent 6ae0402 commit e9e6e1a

File tree

2 files changed

+33
-17
lines changed

2 files changed

+33
-17
lines changed

src/components/ComponentDisplay.vue

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ export default {
148148
return this.activeComponentObj
149149
},
150150
151-
childList () {
152-
return this.componentMap[componentData.componentName].children
153-
},
151+
// childList () {
152+
// return this.componentMap[componentData.componentName].children
153+
// },
154154
155155
options () {
156156
// checks if component has any parents and pushes them into lineage
@@ -328,13 +328,15 @@ export default {
328328
329329
// unhighlights all inactive components
330330
onActivated (componentData) {
331-
this.$refs.boxes.forEach(element => {
332-
if (element.$attrs.id !== componentData.componentName) {
333-
element.enabled = false
334-
element.$emit('deactivated')
335-
element.$emit('update:active', false)
336-
}
337-
})
331+
if (this.$refs.boxes) {
332+
this.$refs.boxes.forEach(element => {
333+
if (element.$attrs.id !== componentData.componentName) {
334+
element.enabled = false
335+
element.$emit('deactivated')
336+
element.$emit('update:active', false)
337+
}
338+
})
339+
}
338340
if (!(componentData.componentName === this.activeComponent)) {
339341
this.setActiveComponent(componentData.componentName)
340342
}

src/components/home_sidebar_items/EditDeleteComponents.vue

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,32 @@ Description:
4747
<q-btn id="deleteButton" @click="deleteSelectedComp(activeComponentData)" label = 'Delete currently selected'/>
4848
<div v-if="this.activeComponentData">
4949
<br/>
50-
<section>Layer:
51-
<q-btn
50+
<section id="counter" style="color: white"> Layer:
51+
<q-btn
5252
class="btn"
5353
color="transparent"
54-
text-color="primary"
54+
text-color="white"
5555
label="-"
5656
@click="e => handleLayer(e)"
5757
/>
58-
<p id="counter" style="color: white">{{ activeComponentObj.z }}</p>
58+
{{ this.activeComponentObj.z }}
59+
<!-- <q-btn
60+
class="btn"
61+
color="transparent"
62+
text-color="white"
63+
label="-"
64+
@click="e => handleLayer(e)"
65+
/> -->
66+
<!-- <p id="counter" style="color: white">{{ this.activeComponentObj.z }}</p> -->
5967
<q-btn
6068
class="btn"
6169
color="transparent"
62-
text-color="primary"
70+
text-color="white"
6371
label="+"
6472
@click="e => handleLayer(e)"
6573
/>
6674
</section>
67-
75+
<br/>
6876
<p> Toggle to edit: </p>
6977
<section class="toggleText"> HTML elements
7078
<toggle-button v-model="showHTML"/> </section>
@@ -166,14 +174,17 @@ export default {
166174
'activeComponentObj',
167175
'componentMap'
168176
]),
177+
169178
activeRouteDisplay () {
170179
let component = this.routes[this.activeRoute]
171180
// console.log('component', component)
172181
return component
173182
},
183+
174184
activeComponentData () {
175185
return this.activeComponentObj
176186
},
187+
177188
options () {
178189
const val = this.activeRouteDisplay.map(
179190
(component) => component.componentName
@@ -227,7 +238,10 @@ export default {
227238
handleLayer (e) {
228239
e.preventDefault()
229240
const payload = {
230-
z: this.activeComponentObj.z
241+
activeComponent: this.activeComponent,
242+
routeArray: this.routes[this.activeRoute],
243+
activeComponentData: this.activeComponentData,
244+
z: this.activeComponentData.z
231245
}
232246
if (e.target.innerText === '+') payload.z++
233247
if (e.target.innerText === '-' && payload.z > 0) payload.z--

0 commit comments

Comments
 (0)