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>
<div class="controls">
<div class="btn-row">
<BaseButton buttonClass="action" @click="addNode()"
>Create Node</BaseButton
>
<BaseButton buttonClass="action" @click="removeLocal()"
>Join another microcosm</BaseButton
>
<BaseButton buttonClass="action" @click="addNode()">Create Node</BaseButton>
<BaseButton buttonClass="action" @click="listView()">List View</BaseButton>
<BaseButton buttonClass="action" @click="removeLocal()">Join another microcosm</BaseButton>
<!-- <BaseButton @click="exportStorage()">Export my contributions</BaseButton>
<BaseButton buttonClass="danger" v-on:click="deleteClient">
Delete my contributions (inc. attachments) permanently
......@@ -49,6 +46,10 @@ export default {
addNode() {
this.$store.dispatch('addNode')
},
listView() {
// FIXME: add action here to toggle visiblity
this.$emit('listView')
},
exportStorage: function() {
// Save local indexeddb document-store 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 @@
></textarea>
</div>
</div>
<!-- FIXME: What is this doing below now ? Looks old -->
<div v-else>
<p :id="nodeid" :inner-html.prop="nodetext | marked">{{ nodeid }}</p>
</div>
......
......@@ -15,8 +15,15 @@
v-bind:nodeid="value.node_id"
v-bind:nodetext="value.node_text"
/>
<ControlsLayer />
<div v-if="listview">
<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>
<OnBoard v-else @clientAdded="clientAdded()" />
</div>
......@@ -27,6 +34,7 @@
import OnBoard from '@/components/OnBoard.vue'
import NodesLayer from '@/components/NodesLayer.vue'
import OtherNodeslayer from '@/components/OtherNodeslayer.vue'
import ListLayer from '@/components/ListLayer.vue'
import ControlsLayer from '@/components/ControlsLayer.vue'
import { mapState } from 'vuex'
......@@ -57,6 +65,7 @@ export default {
data: function() {
return {
clientset: false,
listview: false,
offline: false
}
},
......@@ -65,6 +74,7 @@ export default {
OnBoard,
NodesLayer,
OtherNodeslayer,
ListLayer,
ControlsLayer
},
computed: mapState({
......@@ -86,6 +96,14 @@ export default {
this.$store.dispatch('addNode')
},
listView() {
if (this.listview == false) {
this.listview = true
} else {
this.listview = false
}
},
offlineTriggered() {
this.offline = true
},
......
......@@ -2,6 +2,8 @@
<div>
<h1>This is a Custom 404</h1>
<p>Delightful one coming soon</p>
<!-- FIXME: Put stuffed Monkey here -->
</div>
</template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment