1
1
<template >
2
- <q-footer reveal class =" gradient text-white" :style =" { height: `${height}vh` }" >
2
+ <q-footer reveal class =" gradient text-white" :style =" { height: `${height}vh` }" v-on:click = " handleHtmlDeselection " >
3
3
<q-toolbar class =" toolbar-background" >
4
4
<q-btn flat color =" subaccent" round @click =" openBottomDrawer" >
5
5
<i :class =" [open ? down : up]" id =" btn" ></i >
44
44
</template >
45
45
46
46
<script >
47
- import { mapState } from ' vuex'
47
+ import { mapState , mapActions } from ' vuex'
48
48
import Tree from ' ./Tree'
49
49
import HomeQueue from ' ./HomeQueue'
50
50
import CodeSnippet from ' ./CodeSnippet'
@@ -56,7 +56,7 @@ export default {
56
56
CodeSnippet
57
57
},
58
58
computed: {
59
- ... mapState ([' activeComponent' , ' componentNameInputValue' , ' selectedElementList' ])
59
+ ... mapState ([' activeComponent' , ' componentNameInputValue' , ' selectedElementList' , ' activeHTML ' ])
60
60
},
61
61
data () {
62
62
return {
@@ -68,13 +68,22 @@ export default {
68
68
}
69
69
},
70
70
methods: {
71
+ ... mapActions ([' setActiveHTML' ]),
71
72
openBottomDrawer () {
72
73
// 15in mb pro - 1027 px 3.75
73
74
// big ass screens 2.5
74
75
let minHeight =
75
76
window .outerHeight < 900 ? 4.5 : window .outerHeight < 1035 ? 3.75 : 2.5
76
77
this .height === 40 ? (this .height = minHeight) : (this .height = 40 )
77
78
this .open === true ? (this .open = false ) : (this .open = true )
79
+ },
80
+ handleHtmlDeselection (event ) {
81
+ // method that will handle deselection from active HTML element
82
+ // console.log('target html element: ', event.target)
83
+ if (event .target .className !== ' list-group-item' ) {
84
+ // if html element classname is not equal to this string that all html elements have
85
+ if (! (this .activeHTML === ' ' )) this .setActiveHTML ([' ' ]) // if activeHtml is not already deselected, do so
86
+ }
78
87
}
79
88
},
80
89
// toggles footer to "html" tab when existing component is not in focus
0 commit comments