Skip to content
Snippets Groups Projects
Commit 40ab0a48 authored by Adam Procter's avatar Adam Procter
Browse files

added list view version 0.000001

added a simple list view you can turn on and off. Shows just your list for now and doesnt hide node (spatial view ) yet
parent 3f5952bd
No related branches found
No related tags found
No related merge requests found
<template> <template>
<div class="controls"> <div class="controls">
<div class="btn-row"> <div class="btn-row">
<BaseButton buttonClass="action" @click="addNode()" <BaseButton buttonClass="action" @click="addNode()">Create Node</BaseButton>
>Create Node</BaseButton <BaseButton buttonClass="action" @click="listView()">List View</BaseButton>
> <BaseButton buttonClass="action" @click="removeLocal()">Join another microcosm</BaseButton>
<BaseButton buttonClass="action" @click="removeLocal()"
>Join another microcosm</BaseButton
>
<!-- <BaseButton @click="exportStorage()">Export my contributions</BaseButton> <!-- <BaseButton @click="exportStorage()">Export my contributions</BaseButton>
<BaseButton buttonClass="danger" v-on:click="deleteClient"> <BaseButton buttonClass="danger" v-on:click="deleteClient">
Delete my contributions (inc. attachments) permanently Delete my contributions (inc. attachments) permanently
...@@ -49,6 +46,10 @@ export default { ...@@ -49,6 +46,10 @@ export default {
addNode() { addNode() {
this.$store.dispatch('addNode') this.$store.dispatch('addNode')
}, },
listView() {
// FIXME: add action here to toggle visiblity
this.$emit('listView')
},
exportStorage: function() { exportStorage: function() {
// Save local indexeddb document-store to JSON file // Save local indexeddb document-store to JSON file
// or export state.notes to JSON file // or export state.notes to JSON file
......
<template>
<div class="list">
<ul v-for="value in myNodes" v-bind:key="value.node_id">
<li
class="dataeach"
v-if="nodeid == value.node_id"
:inner-html.prop="value.node_text | marked"
></li>
</ul>
</div>
</template>
<script>
import { mapState } from 'vuex'
import marked from 'marked'
export default {
name: 'ListLayer',
props: {
nodeid: String,
nodetext: String
},
computed: mapState({
myNodes: state => state.myNodes,
otherNodes: state => state.otherNodes
}),
filters: {
// need to write a reverse data filter I suspect here so new data is at the top of list
marked: marked
}
}
</script>
<style lang="css" scoped>
li {
margin-bottom: -15px;
}
</style>
\ No newline at end of file
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
></textarea> ></textarea>
</div> </div>
</div> </div>
<!-- FIXME: What is this doing below now ? Looks old -->
<div v-else> <div v-else>
<p :id="nodeid" :inner-html.prop="nodetext | marked">{{ nodeid }}</p> <p :id="nodeid" :inner-html.prop="nodetext | marked">{{ nodeid }}</p>
</div> </div>
......
...@@ -15,8 +15,15 @@ ...@@ -15,8 +15,15 @@
v-bind:nodeid="value.node_id" v-bind:nodeid="value.node_id"
v-bind:nodetext="value.node_text" v-bind:nodetext="value.node_text"
/> />
<div v-if="listview">
<ControlsLayer /> <ListLayer
v-for="value in myNodes"
v-bind:key="value.node_id"
v-bind:nodeid="value.node_id"
v-bind:nodetext="value.node_text"
/>
</div>
<ControlsLayer @listView="listView()" />
</div> </div>
<OnBoard v-else @clientAdded="clientAdded()" /> <OnBoard v-else @clientAdded="clientAdded()" />
</div> </div>
...@@ -27,6 +34,7 @@ ...@@ -27,6 +34,7 @@
import OnBoard from '@/components/OnBoard.vue' import OnBoard from '@/components/OnBoard.vue'
import NodesLayer from '@/components/NodesLayer.vue' import NodesLayer from '@/components/NodesLayer.vue'
import OtherNodeslayer from '@/components/OtherNodeslayer.vue' import OtherNodeslayer from '@/components/OtherNodeslayer.vue'
import ListLayer from '@/components/ListLayer.vue'
import ControlsLayer from '@/components/ControlsLayer.vue' import ControlsLayer from '@/components/ControlsLayer.vue'
import { mapState } from 'vuex' import { mapState } from 'vuex'
...@@ -57,6 +65,7 @@ export default { ...@@ -57,6 +65,7 @@ export default {
data: function() { data: function() {
return { return {
clientset: false, clientset: false,
listview: false,
offline: false offline: false
} }
}, },
...@@ -65,6 +74,7 @@ export default { ...@@ -65,6 +74,7 @@ export default {
OnBoard, OnBoard,
NodesLayer, NodesLayer,
OtherNodeslayer, OtherNodeslayer,
ListLayer,
ControlsLayer ControlsLayer
}, },
computed: mapState({ computed: mapState({
...@@ -86,6 +96,14 @@ export default { ...@@ -86,6 +96,14 @@ export default {
this.$store.dispatch('addNode') this.$store.dispatch('addNode')
}, },
listView() {
if (this.listview == false) {
this.listview = true
} else {
this.listview = false
}
},
offlineTriggered() { offlineTriggered() {
this.offline = true this.offline = true
}, },
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<div> <div>
<h1>This is a Custom 404</h1> <h1>This is a Custom 404</h1>
<p>Delightful one coming soon</p> <p>Delightful one coming soon</p>
<!-- FIXME: Put stuffed Monkey here -->
</div> </div>
</template> </template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment