Skip to content

Commit 4a79f9c

Browse files
committed
fixed bug of opening html attribute editing menu for children of html elements, also added %, to html element attributes in the code snippet
1 parent bfcf48a commit 4a79f9c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export default {
142142
'clearActiveHTML'
143143
]),
144144
submitClass(element, idNum) {
145+
console.log(this.activeLayer)
145146
if (element === '') {
146147
return;
147148
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Description:
6464
</div>
6565
<br />
6666
</q-expansion-item>
67-
<InputHTMLMenu v-model="attributeModal" v-if="attributeModal === true" class="htmlElement-selected"/>
67+
<InputHTMLMenu v-model="attributeModal" v-if="attributeModal === true && this.activeLayer.lineage.length === 0" class="htmlElement-selected"/>
6868
<q-expansion-item group="accordion" label="HTML Attributes">
6969
<AttributesSubMenu />
7070
</q-expansion-item>
@@ -168,6 +168,7 @@ export default {
168168
"activeRoute",
169169
"activeComponent",
170170
"activeHTML",
171+
"activeLayer",
171172
"activeComponentObj",
172173
"componentMap",
173174
"exportAsTypescript",

src/components/right-sidebar/CodeSnippet.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,10 @@ z-index: ${this.activeComponentObj.z};
256256
}\n`
257257
}
258258
259-
console.log(htmlArray)
260259
for (const html of htmlArray) {
261260
if (html.class === ' ') styleString = "";
262261
if (html.class) {
263-
styleString += `.${html.class} {\n height: ${html.h} \n width: ${html.w} \n top: ${html.x} \n left: ${html.y} \n z-index: ${html.z}
262+
styleString += `.${html.class} {\n height: ${html.h}%, \n width: ${html.w}%, \n top: ${html.x}%, \n left: ${html.y}%, \n z-index: ${html.z}
264263
}\n`
265264
}
266265
}

0 commit comments

Comments
 (0)