Skip to content

Commit bed0221

Browse files
committed
third commit with merged dev and Johnny
1 parent 831377f commit bed0221

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/components/right-sidebar/CodeSnippet.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,15 @@ export default {
8080
// Creates beginner boilerplate
8181
createTemplate(componentName) {
8282
let templateTagStr = this.writeTemplateTag(componentName);
83-
console.log(this.activeComponentObj)
84-
// if(this.activeComponentObj.htmlAttributes.class !== "") return `<template>\n <div class = "${this.activeComponentObj.htmlAttributes.class}">\n${templateTagStr} </div>\n</template>`;
85-
// else return `<template>\n <div>\n${templateTagStr} </div>\n</template>`;
8683
84+
//if/else statement to determine if there are class and id attributes present in the html element
85+
if (this.activeComponentObj.htmlAttributes.class !== "" && this.activeComponentObj.htmlAttributes.id !== "") {
86+
return `<template>\n <div id = "${this.activeComponentObj.htmlAttributes.id}" class = "${this.activeComponentObj.htmlAttributes.class}">\n${templateTagStr} </div>\n</template>`;
87+
} else if (this.activeComponentObj.htmlAttributes.class !== "" && this.activeComponentObj.htmlAttributes.id === "") {
88+
return `<template>\n <div class = "${this.activeComponentObj.htmlAttributes.class}">\n${templateTagStr} </div>\n</template>`;
89+
} else if (this.activeComponentObj.htmlAttributes.class === "" && this.activeComponentObj.htmlAttributes.id !== "")
90+
return `<template>\n <div id = "${this.activeComponentObj.htmlAttributes.id}">\n${templateTagStr} </div>\n</template>`;
91+
else return `<template>\n <div>\n${templateTagStr} </div>\n</template>`;
8792
},
8893
// Creates <template> boilerplate
8994
writeTemplateTag(componentName) {

src/components/right-sidebar/HTMLQueue.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Description:
7575
<div class="formBox">
7676
<q-form autofocus v-on:submit.prevent="submitClass">
7777
<p class="title">Add Class Name:</p>
78-
<q-input label="Add your note here" filled dark autofocus true hide-bottom-space v-model="classText"
78+
<q-input label="Add your class here" filled dark autofocus true hide-bottom-space v-model="classText"
7979
@keyup.enter="submitClass"></q-input>
8080
<q-btn id="comp-btn" class="sidebar-btn" color="secondary" label="Submit Attribute"
8181
:disable="classText.length > 0 ? false : true" @click="submitClass(classText, this.activeHTML)" />

0 commit comments

Comments
 (0)