This repository has been archived by the owner on May 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
SpeckleStreamList.vue
106 lines (101 loc) · 2.55 KB
/
SpeckleStreamList.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<template>
<div id="stream-list-cover">
<div class='list-menu'>
<md-button class="md-icon-button md-warn" @click.native='showNewStreamDialgue = true'>
<md-icon>add</md-icon>
</md-button>
<md-button class="md-icon-button md-primary" @click.native='toggleStreamList'>
<md-icon>{{ showStreamList ? 'keyboard_arrow_left':'keyboard_arrow_right' }}</md-icon>
<md-tooltip> {{ showStreamList ? 'Hide' : 'Show' }} the stream list.</md-tooltip>
</md-button>
</div>
<div id='stream-list' class='' ref='thestreamlist'>
<speckle-receiver v-for='receiver in receivers' :key='receiver.streamId' :spkreceiver='receiver'></speckle-receiver>
<div class='paddedcard' style='position:relative;' v-show='receivers.length === 0'>
<div class="md-title">There are no clients to show.</div>
<p>You can add a new client by click on the add button above.</p>
</div>
</div>
<speckle-new-stream-dialog v-on:close='showNewStreamDialgue = false' v-show='showNewStreamDialgue'></speckle-new-stream-dialog>
</div>
</template>
<script>
import SpeckleReceiver from './SpeckleReceiver.vue'
import SpeckleNewStreamDialog from './SpeckleNewStreamDialog.vue'
import NewReceiver from './NewReceiver.vue'
export default {
name: 'SpeckleStreamList',
components: {
SpeckleReceiver,
NewReceiver,
SpeckleNewStreamDialog
},
computed: {
receivers() {
return this.$store.getters.allReceivers
}
},
data() {
return {
showStreamList: true,
showNewStreamDialgue: false
}
},
methods: {
dialogClosed() {
},
toggleStreamList() {
this.showStreamList = ! this.showStreamList
console.log(this.$refs.thestreamlist )
this.$refs.thestreamlist.classList.toggle('hidden')
}
},
created() {
bus.$on('showstreamadd', () => {
this.showNewStreamDialgue = true
})
}
}
</script>
<style scoped>
#stream-list-cover{
position: fixed;
padding-top: 10px;
padding-bottom: 10px;
top:0px;
height: 100%;
left: 10px;
width: 340px;
overflow: hidden;
z-index: 99;
pointer-events: none;
box-sizing: border-box;
}
.list-menu {
pointer-events: auto;
position: relative;
left: 10px;
margin-bottom: 10px;
height: 5%;
}
#stream-list {
position: relative;
padding-right: 10px;
left: 10px;
top: 0;
max-height:95%;
width: 350px;
box-sizing: border-box;
overflow-y: scroll;
z-index: 100;
pointer-events: auto;
transition: all .2s ease;
opacity: 1;
}
#stream-list.hidden{
left: -500px;
opacity: 0;
}
#stream-list div {
}
</style>