Skip to content

Commit d01252f

Browse files
committed
bugs fixed from selecting HTML Elements then having nested html elements, this is done by having a clearActiveHTML function in the closing button for editing HTML Element properties
1 parent f66b132 commit d01252f

File tree

7 files changed

+52
-11
lines changed

7 files changed

+52
-11
lines changed

src/components/Canvas.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
>
4545

4646
<div class="component-title">
47-
<p>{{ componentData.componentName }}</p>
47+
<p>{{ componentData.componentName }}{{this.activeLayer.id}}</p>
4848
</div>
4949
<q-icon v-if="componentData.componentName === this.activeComponent"
5050
size="25px"

src/components/left-sidebar/ComponentTab/InputHTMLMenu.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
v-model="heightText"
2424
:min="0"
2525
:max="100"
26+
tabindex="element.h"
2627
vertical
2728
label
2829
label-always
@@ -93,7 +94,8 @@
9394
@click="submitLeft(leftText, this.activeHTML)">
9495
</i>
9596
</q-input>
96-
<q-btn label="Close" @click="this.openAttributeModal" />
97+
<q-btn label="Close HTML Element" class="closeBtn" @click="closeMenu({text: 'reset', id: 'reset' })" />
98+
<!-- setParentLayer -->
9799
</q-form>
98100
</div>
99101
</div>
@@ -137,6 +139,7 @@ export default {
137139
'addActiveComponentWidth',
138140
'addActiveComponentTop',
139141
'addActiveComponentLeft',
142+
'clearActiveHTML'
140143
]),
141144
submitClass(element, idNum) {
142145
if (element === '') {
@@ -204,7 +207,12 @@ export default {
204207
this.addActiveComponentLeft(payload);
205208
this.leftText = '';
206209
},
207-
210+
closeMenu(element) {
211+
if (this.activeComponent !== '') {
212+
this.clearActiveHTML()
213+
this.openAttributeModal(element);
214+
}
215+
},
208216
},
209217
watch: {
210218
attributeModalOpen() {
@@ -230,4 +238,10 @@ export default {
230238
.title {
231239
font-size: 1.3em
232240
}
241+
242+
.closeBtn {
243+
background-color: $primary;
244+
margin-bottom: 2em;
245+
width: 100%;
246+
}
233247
</style>

src/components/left-sidebar/ComponentTab/UpdateMenu.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export default {
167167
"routes",
168168
"activeRoute",
169169
"activeComponent",
170+
"activeHTML",
170171
"activeComponentObj",
171172
"componentMap",
172173
"exportAsTypescript",

src/components/right-sidebar/HTMLQueue.vue

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Description:
88
<section class="html-queue" @dragover="dragOver($event), false">
99
<span class='list-title' v-if='this.activeLayer.id !== ""'>
1010
<i class="fas fa fa-chevron-up fa-md" @click="setParentLayer"></i>
11-
12-
&nbsp; &nbsp; Viewing Elements in {{this.activeComponent}} '{{ depth }}'
11+
&nbsp; &nbsp; Viewing Elements in {{this.activeComponent}} '{{ depth }}'
1312
<hr>
1413
</span>
1514
<span class='list-title' v-else-if='!this.activeComponent'></span>
@@ -109,7 +108,14 @@ export default {
109108
}
110109
},
111110
computed: {
112-
...mapState(['selectedElementList', 'componentMap', 'activeComponent', 'activeHTML', 'activeLayer', 'attributeModalOpen']),
111+
...mapState([
112+
'selectedElementList',
113+
'componentMap',
114+
'activeComponent',
115+
'activeHTML',
116+
'activeLayer',
117+
'attributeModalOpen'
118+
]),
113119
renderList: {
114120
get() {
115121
if (this.activeComponent === '') return this.selectedElementList.map((el, index) => [el.text, index, el.id])
@@ -139,17 +145,29 @@ export default {
139145
}
140146
},
141147
methods: {
142-
...mapActions(['setActiveHTML', 'setActiveLayer', 'upOneLayer', 'setSelectedIdDrag', 'setIdDrag', 'setSelectedIdDrop', 'setIdDrop', 'dragDropSortHtmlElements', 'dragDropSortSelectedHtmlElements', 'openAttributeModal', 'addActiveComponentClass']),
148+
...mapActions([
149+
'setActiveHTML',
150+
'setActiveLayer',
151+
'upOneLayer',
152+
'setSelectedIdDrag',
153+
'setIdDrag',
154+
'setSelectedIdDrop',
155+
'setIdDrop',
156+
'dragDropSortHtmlElements',
157+
'dragDropSortSelectedHtmlElements',
158+
'openAttributeModal',
159+
'addActiveComponentClass']),
143160
deleteElement (id) {
144161
if (this.activeComponent === '') this.$store.dispatch(deleteSelectedElement, id[0])
145162
else this.$store.dispatch(deleteFromComponentHtmlList, id[1])
146163
},
147164
setActiveElement(element) {
148165
if (this.activeComponent !== '') {
149166
this.setActiveHTML(element);
150-
this.openAttributeModal(element);
167+
if (this.attributeModal === false) {
168+
this.openAttributeModal(element);
151169
}
152-
170+
}
153171
},
154172
setLayer(element) {
155173
this.setActiveLayer(element)

src/store/actions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ const actions = {
319319
commit(types.SET_ACTIVE_HTML_ELEMENT, payload);
320320
},
321321

322+
[types.clearActiveHTML]: ({ commit }, payload) => {
323+
commit(types.CLEAR_ACTIVE_HTML, payload);
324+
},
325+
322326
[types.setActiveLayer]: ({ commit }, payload) => {
323327
commit(types.SET_ACTIVE_LAYER, payload);
324328
},

src/store/mutations.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ const mutations = {
358358
});
359359
},
360360

361+
[types.CLEAR_ACTIVE_HTML]: (state) => {
362+
state.activeHTML = '';
363+
},
364+
361365
[types.ADD_NESTED_NO_ACTIVE]: (state, payload) => {
362366
const componentName = state.activeComponent;
363367
const { activeLayer } = state;

src/store/types.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const ADD_ACTIVE_COMPONENT_WIDTH = 'ADD_ACTIVE_COMPONENT_WIDTH'
7979
export const ADD_ACTIVE_COMPONENT_TOP = 'ADD_ACTIVE_COMPONENT_TOP'
8080
export const ADD_ACTIVE_COMPONENT_LEFT = 'ADD_ACTIVE_COMPONENT_LEFT'
8181
export const ADD_ACTIVE_COMPONENT_ELEMENT_NOTE = 'ADD_ACTIVE_COMPONENT_ELEMENT_NOTE'
82-
82+
export const CLEAR_ACTIVE_HTML = 'CLEAR_ACTIVE_HTML'
8383

8484
//
8585
export const REMOVE_ALL_STATE_PROPS_ACTIONS = 'REMOVE_ALL_STATE_PROPS_ACTIONS'
@@ -104,7 +104,7 @@ export const addActiveComponentWidth = 'addActiveComponentWidth'
104104
export const addActiveComponentTop = 'addActiveComponentTop'
105105
export const addActiveComponentLeft = 'addActiveComponentLeft'
106106
export const addActiveComponentElementNote = 'addActiveComponentElementNote'
107-
107+
export const clearActiveHTML = 'clearActiveHTML'
108108

109109

110110
//

0 commit comments

Comments
 (0)