Skip to content

Commit 10488d1

Browse files
authored
Merge pull request #26 from JojuOlaode/stretchHtml
Stretch html
2 parents 192fe96 + 9bbdb8f commit 10488d1

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/components/Footer.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<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">
33
<q-toolbar class="toolbar-background">
44
<q-btn flat color="subaccent" round @click="openBottomDrawer">
55
<i :class="[open ? down : up]" id="btn"></i>
@@ -44,7 +44,7 @@
4444
</template>
4545

4646
<script>
47-
import { mapState } from 'vuex'
47+
import { mapState, mapActions } from 'vuex'
4848
import Tree from './Tree'
4949
import HomeQueue from './HomeQueue'
5050
import CodeSnippet from './CodeSnippet'
@@ -56,7 +56,7 @@ export default {
5656
CodeSnippet
5757
},
5858
computed: {
59-
...mapState(['activeComponent', 'componentNameInputValue', 'selectedElementList'])
59+
...mapState(['activeComponent', 'componentNameInputValue', 'selectedElementList', 'activeHTML'])
6060
},
6161
data () {
6262
return {
@@ -68,13 +68,22 @@ export default {
6868
}
6969
},
7070
methods: {
71+
...mapActions(['setActiveHTML']),
7172
openBottomDrawer () {
7273
// 15in mb pro - 1027 px 3.75
7374
// big ass screens 2.5
7475
let minHeight =
7576
window.outerHeight < 900 ? 4.5 : window.outerHeight < 1035 ? 3.75 : 2.5
7677
this.height === 40 ? (this.height = minHeight) : (this.height = 40)
7778
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+
}
7887
}
7988
},
8089
// toggles footer to "html" tab when existing component is not in focus

src/components/HomeQueue.vue

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<template>
2-
<section class="home-queue" v-on:click="handleClick">
2+
<section class="home-queue">
33
<i v-if='this.activeLayer.id !== ""' class="fas fa fa-chevron-up fa-md" @click="setParentLayer"></i>
44
<span class='list-title' v-if='this.activeLayer.id !== ""'> Viewing Elements in '{{ this.activeComponent }} {{ this.depth }}' </span>
55
<span class='list-title' v-else-if='this.activeComponent !==""'> Viewing Elements in '{{ this.activeComponent }}' </span>
66
<span class='list-title' v-else> Elements in Queue </span>
77
<hr>
88
<div
9-
v-model="renderList"
109
group="people"
1110
class="list-group"
1211
>
13-
12+
1413
<div
1514
:class="activeHTML === element[2] ? 'list-group-item-selected' : 'list-group-item'"
1615
@dblclick.self="setActiveElement(element)"
@@ -28,7 +27,6 @@
2827
</template>
2928

3029
<script>
31-
import draggable from 'vuedraggable'
3230
import { mapState, mapActions } from 'vuex'
3331
import { setSelectedElementList, deleteSelectedElement, deleteFromComponentHtmlList } from '../store/types'
3432
@@ -112,12 +110,6 @@ export default {
112110
newTitle += ` > ${el}`
113111
})
114112
this.depth = newTitle
115-
},
116-
handleClick (event) {
117-
// console.log(event.target)
118-
if (event.target.className === 'home-queue') {
119-
if (!(this.activeHTML === '')) this.setActiveHTML([''])
120-
}
121113
}
122114
},
123115
watch: {

0 commit comments

Comments
 (0)