|
1 | 1 | <template>
|
2 | 2 | <section class="home-queue" v-on:click="handleClick">
|
3 |
| - <span class='list-title' v-if='this.activeComponent !==""'> Viewing Elements in '{{ this.activeComponent }}' </span> |
| 3 | + <span class='list-title' v-if='this.activeLayer.id !== ""'> Viewing Elements in '{{ this.activeComponent }} - {{ this.activeLayer.lineage }}' </span> |
| 4 | + <!-- <span class='list-title' v-if='this.activeLayer.id !== ""'> Viewing Elements in '{{ this.activeLayer.lineage }}' </span> --> |
| 5 | + <span class='list-title' v-else-if='this.activeComponent !==""'> Viewing Elements in '{{ this.activeComponent }}' </span> |
4 | 6 | <span class='list-title' v-else> Elements in Queue </span>
|
5 | 7 | <hr>
|
6 | 8 | <draggable
|
|
11 | 13 | @start="drag = true"
|
12 | 14 | @end="drag = false"
|
13 | 15 | >
|
14 |
| - <!-- <div class="list-group-item" @dblclick="setActiveElement(element)" v-for="(element) in renderList" :key="element[1] + Date.now()"> --> |
15 | 16 | <div :class="activeHTML === element[2] ? 'list-group-item-selected' : 'list-group-item'" @dblclick="setActiveElement(element)" v-for="(element) in renderList" :key="element[1] + Date.now()">
|
| 17 | + <i class="fas fa fa-angle-double-down fa-md" @click="setLayer({text: element[0], id: element[2]})"></i> |
16 | 18 | {{ element[0] }}
|
17 | 19 | <i class="fas fa fa-trash fa-md" @click="deleteElement(element[1])"></i>
|
18 | 20 | </div>
|
|
23 | 25 | <script>
|
24 | 26 | import draggable from 'vuedraggable'
|
25 | 27 | import { mapState, mapActions } from 'vuex'
|
26 |
| -import { setSelectedElementList, deleteSelectedElement, deleteFromComponentHtmlList, setActiveHTML } from '../store/types' |
| 28 | +import { setSelectedElementList, deleteSelectedElement, deleteFromComponentHtmlList, setActiveHTML, setActiveLayer } from '../store/types' |
27 | 29 |
|
28 | 30 | const breadthFirstSearch = (array, id) => {
|
29 | 31 | let queue = [...array.filter(el => typeof el === 'object')];
|
@@ -81,14 +83,17 @@ export default {
|
81 | 83 | }
|
82 | 84 | },
|
83 | 85 | methods: {
|
84 |
| - ...mapActions(['setActiveHTML']), |
| 86 | + ...mapActions(['setActiveHTML', 'setActiveLayer']), |
85 | 87 | deleteElement (index) {
|
86 | 88 | if (this.activeComponent === '') this.$store.dispatch(deleteSelectedElement, index)
|
87 | 89 | else this.$store.dispatch(deleteFromComponentHtmlList, index)
|
88 | 90 | },
|
89 | 91 | setActiveElement (element) {
|
90 | 92 | this.$store.dispatch(setActiveHTML, element)
|
91 | 93 | },
|
| 94 | + setLayer (element) { |
| 95 | + this.$store.dispatch(setActiveLayer, element) |
| 96 | + }, |
92 | 97 | handleClick (event) {
|
93 | 98 | console.log(event.target)
|
94 | 99 | if (event.target.className === 'home-queue') {
|
@@ -151,9 +156,20 @@ li {
|
151 | 156 | cursor: pointer;
|
152 | 157 | color: red;
|
153 | 158 | }
|
| 159 | +
|
154 | 160 | .fa-trash {
|
155 | 161 | position: relative;
|
156 | 162 | left: 20px;
|
| 163 | +
|
| 164 | +} |
| 165 | +.fa-angle-double-down { |
| 166 | + position: relative; |
| 167 | + right: 20px; |
| 168 | +} |
| 169 | +
|
| 170 | +.fa-angle-double-down:hover { |
| 171 | + cursor: pointer; |
| 172 | + color: #41B883; |
157 | 173 | }
|
158 | 174 | hr {
|
159 | 175 | border: 1px solid grey
|
|
0 commit comments