diff --git a/app/src/components/CardsLayer.vue b/app/src/components/CardsLayer.vue index 0ec9a4d63e9c405825d9554ff23883cbfe6da9a2..3bb166b8f10b56669ae514c14c5221b1f834cb9f 100644 --- a/app/src/components/CardsLayer.vue +++ b/app/src/components/CardsLayer.vue @@ -1,6 +1,6 @@ <template> <div class="grid"> - <div v-for="(nodes, index) in nodes_filtered" v-bind:key="index"> + <div v-for="(nodes, index) in $options.myArray" v-bind:key="index"> <form class="nodes"> <template v-if="nodes.read_mode == false"> <textarea @@ -60,6 +60,7 @@ export default { data: function () { return { localreadmode: false, + myArray: null, } }, @@ -81,13 +82,22 @@ export default { }, // this is to stop sync chasing bug - myArray: null, - mounted() { + + created() { //access the custom option using $options + setTimeout(this.loadData, 500) this.$options.myArray = this.nodes_filtered }, + updated() { + setTimeout(this.loadData, 300) + }, + methods: { + loadData() { + this.$options.myArray = this.nodes_filtered + this.$forceUpdate() + }, editNode(e) { var nodeid = e.target.id var nodetext = e.target.value diff --git a/app/src/components/ListLayer.vue b/app/src/components/ListLayer.vue index fe48288b8423c4d65ae45150dafc2fac89b64fcd..7ddea2a732e62890a55add136e9f26723c589295 100644 --- a/app/src/components/ListLayer.vue +++ b/app/src/components/ListLayer.vue @@ -1,6 +1,6 @@ <template> <div> - <div v-for="(nodes, index) in nodes_filtered" v-bind:key="index"> + <div v-for="(nodes, index) in $options.myArray" v-bind:key="index"> <form class="nodes"> <template v-if="nodes.read_mode == false"> <textarea @@ -61,6 +61,7 @@ export default { data: function () { return { localreadmode: false, + myArray: null, } }, @@ -73,6 +74,7 @@ export default { myNodes: (state) => state.myNodes, configPositions: (state) => state.configPositions, configEmoji: (state) => state.configEmoji, + // toolmode: (state) => state.ui.mode, }), nodes_filtered: function () { @@ -82,14 +84,20 @@ export default { }, }, - // this is to stop sync chasing bug - myArray: null, mounted() { - //access the custom option using $options + setTimeout(this.loadData, 500) this.$options.myArray = this.nodes_filtered }, + updated() { + setTimeout(this.loadData, 300) + }, + methods: { + loadData() { + this.$options.myArray = this.nodes_filtered + this.$forceUpdate() + }, editNode(e) { var nodeid = e.target.id var nodetext = e.target.value diff --git a/app/src/components/NodesLayer.vue b/app/src/components/NodesLayer.vue index 308d863465b1af38e296de7b2b0e073e07061fad..5e9992263d5bb90d086332ff84040b68f4d13540 100644 --- a/app/src/components/NodesLayer.vue +++ b/app/src/components/NodesLayer.vue @@ -172,7 +172,8 @@ export default { localreadmode: false, mode: '', nodeid: String, - // firstload: true, + myArray: null, + positionsArray: null, } }, @@ -219,25 +220,30 @@ export default { }, }, // this is to stop sync chasing bug - myArray: null, - positionsArray: null, - // NOTE: ok as created here but NOT if this is the first view to load + created() { //access the custom option using $options + setTimeout(this.loadData, 2000) this.$options.myArray = this.nodes_filtered this.$options.positionsArray = this.positions_filtered }, updated() { this.$options.positionsArray = this.positions_filtered - + if (this.toolmode == 'addNode') { - this.$options.myArray = this.nodes_filtered + setTimeout(this.loadData, 300) + // this.$options.myArray = this.nodes_filtered this.$store.commit('ui/setMode', 'select') } }, methods: { + loadData() { + this.$options.myArray = this.nodes_filtered + this.$options.positionsArray = this.positions_filtered + this.$forceUpdate() + }, onActivated(e) { this.nodeid = e var i diff --git a/app/src/components/OtherNodeslayer.vue b/app/src/components/OtherNodeslayer.vue index 4bea445da702a2829518cf5375cd45b30aae21f5..6fb64f63159dc2718f28d8b89fe2f996b6cf7dff 100644 --- a/app/src/components/OtherNodeslayer.vue +++ b/app/src/components/OtherNodeslayer.vue @@ -240,6 +240,8 @@ export default { search: '', pickupz: 1, nodeid: String, + + positionsArray: null, } }, @@ -272,10 +274,10 @@ export default { }, }, - positionsArray: null, // NOTE: ok as created here but NOT if this is the first view to load created() { //access the custom option using $options + setTimeout(this.loadData, 1000) this.$options.positionsArray = this.positions_filtered }, @@ -284,6 +286,10 @@ export default { }, methods: { + loadData() { + this.$options.positionsArray = this.positions_filtered + this.$forceUpdate() + }, onActivated(e) { this.nodeid = e var i diff --git a/app/src/experimental/ModeToolbar.vue b/app/src/experimental/ModeToolbar.vue index 103cefcc4b224859e46a67766eed2ce8961fe575..57b1e7412f22e48f932b8ef65893c13145d8618e 100644 --- a/app/src/experimental/ModeToolbar.vue +++ b/app/src/experimental/ModeToolbar.vue @@ -49,7 +49,8 @@ export default { } } if (mode == 'addNode') { - this.$store.dispatch('addNode') + this.$emit('add-node') + // this.$store.dispatch('addNode') } if (mode == 'upload') { this.$emit('upload-added') diff --git a/app/src/views/Organise.vue b/app/src/views/Organise.vue index 77df0612a1242d2c68da39e199adfe0761627281..f0325accc840857086795cfa275dde0bf9de2f53 100644 --- a/app/src/views/Organise.vue +++ b/app/src/views/Organise.vue @@ -61,6 +61,7 @@ @copy-done="copyDone()" @draw-on="drawOn()" @draw-off="drawOff()" + @add-node="addNode()" /> <ViewToolbar /> <UploadLayer @@ -192,6 +193,7 @@ export default { // This is here to support the shortcuts addNode() { this.$store.dispatch('addNode') + this.$forceUpdate() }, selectMode(mode) { this.$store.commit('ui/setMode', mode)