Skip to content

Commit 3773c82

Browse files
authored
Merge pull request #8 from keliphan/buttonResponse
updated footer toggling and fixed component name creation
2 parents 84c287a + feec594 commit 3773c82

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/components/CreateComponent.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ export default {
6363
'addToComponentElementList'
6464
]),
6565
handleClick () {
66+
if (!this.componentNameInputValue.trim()) {
67+
event.preventDefault();
68+
return false;
69+
}
6670
const component = {
6771
componentName: this.componentNameInputValue,
6872
x: 0,
@@ -75,6 +79,7 @@ export default {
7579
}
7680
7781
this.registerComponent(component)
82+
7883
},
7984
resetActiveComponent () {
8085
this.setActiveComponent('')

src/components/Footer.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ export default {
8888
// toggles footer to "html" tab if component name has value & elements are in queue
8989
componentNameInputValue: function() {
9090
// console.log('watching componentNameInputVal')
91-
if (this.componentNameInputValue !== '' && this.selectedElementList.length !== 0) {
92-
console.log(this.selectedElementList)
91+
if (this.componentNameInputValue !== '' && this.selectedElementList.length !== 0 && this.activeComponent === '') {
92+
// console.log(this.selectedElementList)
9393
this.tab = 'html'
9494
}
9595
},
9696
// toggles footer to "html" tab if elements are added to queue on component creation
9797
selectedElementList: function() {
9898
// console.log('watching selectedElementList')
99-
if (this.activeComponent === '') {
99+
if (this.activeComponent === '' && this.selectedElementList.length !== 0) {
100100
this.tab = 'html'
101101
}
102102
}

src/components/HomeQueue.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default {
6262
},
6363
watch: {
6464
activeComponent: function () {
65-
console.log('watching activeComponent in HomeQueue');
65+
// console.log('watching activeComponent in HomeQueue')
6666
if (this.activeComponent !== '') {
6767
this.component = true
6868
} else {

0 commit comments

Comments
 (0)