@@ -33,27 +33,6 @@ Description:
33
33
</div >
34
34
</div >
35
35
36
- <!-- START OF CHANGES-->
37
- <!-- Viewing Elements in {{ this.activeComponent }} '{{ depth }}'
38
- <hr>
39
- </span>
40
- <span class='list-title' v-else-if='!this.activeComponent'></span>
41
- <div group="people" class="list-group">
42
- <p v-if='!this.componentMap[this.activeComponent]?.htmlList.length'>No HTML elements in component</p>
43
-
44
- <div id="tooltipCon" :class="activeHTML === element[2] ? 'list-group-item-selected' : 'list-group-item'"
45
- v-for="(element) in renderList" :key="element[1] + Date.now()">
46
-
47
- <button class="attributeButton" @click="setActiveElement(element)">
48
- <div class="tooltip"> Edit {{ element[0] }} attributes </div>
49
- </button>
50
- <i v-if='activeComponent === "" || exceptions.includes(element[0])'></i>
51
- <i v-else class="fas fa fa-angle-double-down fa-md" @click="setLayer({ text: element[0], id: element[2] })"></i>
52
- {{ element[0] }}
53
- <i class="fas fa fa-trash fa-md" @click.self="deleteElement([element[1], element[2]])"></i>
54
- </div>
55
- </div> -->
56
-
57
36
<!-- attribute pop-up -->
58
37
<q-dialog v-model =" attributeModal" >
59
38
<!-- @update:model-value="setActiveElement" -->
@@ -63,7 +42,12 @@ Description:
63
42
<div class =" AttributeContainer" v-for =" element in this.componentMap[this.activeComponent].htmlList"
64
43
:key =" element.id + Date.now()" >
65
44
<p v-if =" element.id === this.activeHTML" >Your class is - {{ element.class }}</p >
45
+ <p v-if =" element.id === this.activeHTML" > You've binded to - {{ element.binding }}</p >
66
46
</div >
47
+ <!-- <div class="AttributeContainer" v-for="element in this.componentMap[this.activeComponent].htmlList"
48
+ :key="element.id + Date.now()">
49
+
50
+ </div> -->
67
51
68
52
<div class =" formBox" >
69
53
<q-form autofocus v-on:submit.prevent =" submitClass" >
@@ -72,8 +56,17 @@ Description:
72
56
@keyup.enter =" submitClass" ></q-input >
73
57
<q-btn id =" comp-btn" class =" sidebar-btn" color =" secondary" label =" Submit Attribute"
74
58
:disable =" classText.length > 0 ? false : true" @click =" submitClass(classText, this.activeHTML)" />
75
- <q-btn label =" Close" @click =" this.openAttributeModal" />
76
59
</q-form >
60
+ <q-form autofocus v-on:submit.prevent =" addBinding" >
61
+ <p class =" title" >Add Binding:</p >
62
+
63
+ <q-input label =" Add two way binding here" filled dark autofocus true hide-bottom-space v-model =" bindingText"
64
+ @keyup.enter =" addBinding" ></q-input >
65
+ <q-btn id =" comp-btn" class =" sidebar-btn" color =" secondary" label =" Add Binding"
66
+ :disable =" bindingText.length > 0 ? false : true" @click =" addBinding(bindingText, this.activeHTML)" >
67
+ </q-btn >
68
+ </q-form >
69
+ <q-btn label =" Close" @click =" this.openAttributeModal" />
77
70
</div >
78
71
</div >
79
72
</q-dialog >
@@ -102,6 +95,7 @@ export default {
102
95
exceptions: [' input' , ' img' , ' link' ],
103
96
attributeModal: false ,
104
97
classText: ' ' ,
98
+ bindingText: ' ' ,
105
99
}
106
100
},
107
101
computed: {
@@ -136,13 +130,19 @@ export default {
136
130
137
131
},
138
132
methods: {
139
- ... mapActions ([' setActiveHTML' , ' setActiveLayer' , ' upOneLayer' , ' setSelectedIdDrag' , ' setIdDrag' , ' setSelectedIdDrop' , ' setIdDrop' , ' dragDropSortHtmlElements' , ' dragDropSortSelectedHtmlElements' , ' openAttributeModal' , ' addActiveComponentClass' ]),
133
+ ... mapActions ([' setActiveHTML' , ' setActiveLayer' , ' upOneLayer' , ' setSelectedIdDrag' , ' setIdDrag' , ' setSelectedIdDrop' , ' setIdDrop' , ' dragDropSortHtmlElements' , ' dragDropSortSelectedHtmlElements' , ' openAttributeModal' , ' addActiveComponentClass' , ' addBindingText ' ]),
140
134
deleteElement (id ) {
141
135
if (this .activeComponent === ' ' ) this .$store .dispatch (deleteSelectedElement, id[0 ])
142
136
this .setActiveHTML (element);
143
137
this .openAttributeModal (element);
144
138
145
139
},
140
+ setActiveElement (element ) {
141
+ if (this .activeComponent !== ' ' ) {
142
+ this .setActiveHTML (element);
143
+ this .openAttributeModal (element);
144
+ }
145
+ },
146
146
setLayer (element ) {
147
147
this .setActiveLayer (element)
148
148
element .id = this .activeHTML
@@ -182,22 +182,25 @@ export default {
182
182
if (element === ' ' ) {
183
183
return ;
184
184
}
185
+
185
186
let payload = {
186
187
class: element,
187
188
id: idNum
188
189
}
189
190
this .addActiveComponentClass (payload);
190
191
this .classText = ' ' ;
191
192
},
192
- // addBinding(element, idNum) {
193
- // if (element === '') {
194
- // return;
195
- // }
196
- // let payload = {
197
- // binding: element,
198
- // id: idNum
199
- // }
200
- // },
193
+ addBinding (input , idNum ) {
194
+ if (input === ' ' ) {
195
+ return ;
196
+ }
197
+ const payload = {
198
+ binding: input,
199
+ id: idNum
200
+ }
201
+ this .addBindingText (payload);
202
+ this .bindingText = ' ' ;
203
+ },
201
204
},
202
205
watch: {
203
206
attributeModalOpen () {
0 commit comments