Administrator approval is now required for registering new accounts. If you are registering a new account, and are external to the University, please ask the repository owner to contact ServiceLine to request your account be approved. Repository owners must include the newly registered email address, and specific repository in the request for approval.

Commit 23eccb12 authored by Adam Procter's avatar Adam Procter
Browse files

fixed initialisation of positions document

parent d35c918d
...@@ -133,11 +133,15 @@ export default { ...@@ -133,11 +133,15 @@ export default {
}, },
mounted() { mounted() {
// this.$store.dispatch('getEmoji')
// this.$store.dispatch('getPositions')
setTimeout(this.loadData, 500) setTimeout(this.loadData, 500)
if (localStorage.nogg_name && localStorage.nogg_microcosm) { if (localStorage.nogg_name && localStorage.nogg_microcosm) {
var devicename = localStorage.nogg_name var devicename = localStorage.nogg_name
var microcosm = localStorage.nogg_microcosm var microcosm = localStorage.nogg_microcosm
this.$store.dispatch('setMicrocosm', { devicename, microcosm }) this.$store.dispatch('setMicrocosm', { devicename, microcosm })
// this.$store.dispatch('getEmoji')
// this.$store.dispatch('getPositions')
} else { } else {
console.log('no') console.log('no')
// go home // go home
......
...@@ -80,6 +80,7 @@ export default { ...@@ -80,6 +80,7 @@ export default {
mounted() { mounted() {
this.$store.dispatch('getOthernodes') this.$store.dispatch('getOthernodes')
this.$store.dispatch('getEmoji')
setTimeout(this.loadData, 500) setTimeout(this.loadData, 500)
// this is to get the last letter typed if no space // this is to get the last letter typed if no space
// this also loads in new Emoji // this also loads in new Emoji
......
var pouchdb var pouchdb
var deviceName var deviceName
var docPositions var docPositions
export const state = { export const state = {
...@@ -63,7 +64,7 @@ export const mutations = { ...@@ -63,7 +64,7 @@ export const mutations = {
}) })
return pouchdb return pouchdb
.put({ .put({
_id: state.allPos, _id: docPositions,
_rev: doc._rev, _rev: doc._rev,
positions: doc.positions, positions: doc.positions,
}) })
...@@ -112,7 +113,26 @@ export const mutations = { ...@@ -112,7 +113,26 @@ export const mutations = {
.catch(function (err) { .catch(function (err) {
console.log(err) console.log(err)
}) })
// ADD POSITIONS CODE HERE ONCE WORKING pouchdb.get(docPositions).then(function (doc) {
doc.positions.push({
node_id: uniqueid,
node_x: 0,
node_y: 0,
node_width: 200,
node_height: 370,
node_zindex: 0,
node_sort: 0,
})
return pouchdb
.put({
_id: docPositions,
_rev: doc._rev,
positions: doc.positions,
})
.catch(function (err) {
console.log(err)
})
})
} }
}) })
}, },
......
...@@ -27,7 +27,8 @@ export const mutations = { ...@@ -27,7 +27,8 @@ export const mutations = {
state.otherNodes = [] state.otherNodes = []
var i var i
var j var j
console.log(state.allNodes) // console.log(docEmoji)
// console.log(docPositions)
for (i = 0; i < Object.keys(state.allNodes).length; i++) { for (i = 0; i < Object.keys(state.allNodes).length; i++) {
if ( if (
state.allNodes[i].id != deviceName && state.allNodes[i].id != deviceName &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment