Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta #20

Merged
merged 8 commits into from
Jan 8, 2021
Merged

Beta #20

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make the UI Layer only sync peers' elements
  • Loading branch information
sjbrown committed Jan 6, 2021
commit 9e3636df36f52b91dcdf828c868f9f9aa52ac84c
16 changes: 8 additions & 8 deletions src/come_together.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ togetherFunctions.on_sync = (msg) => {
myViewport = document.querySelector('#svg_viewport')
myViewport.style.backgroundImage = newViewport.style.backgroundImage
svg_table.node.querySelectorAll('.draggable-group').forEach((el) => {
if (el.classList.contains('owner-' + ui.escapedClientId())) {
// Don't delete my own objects in layer_ui
return
}
el.remove()
})
return load_new_table(newTable)
Expand All @@ -469,15 +473,11 @@ async function load_new_table(newTable) {
svg_table.node.insertBefore(layerEl, layer_ui.node)
})
.then(() => {
document.querySelectorAll('#layer_ui > svg').forEach((el) => {
// console.log('layer-ui examining', el)
if (!el.classList.contains('owner-' + ui.escapedClientId())) {
// console.log('layer-ui removig', el)
el.remove()
}
})
return newTable.querySelectorAll('#layer_ui > .draggable-group').forEach((el) => {
el.remove()
console.log('layer-ui examining draggable gropu', el)
if (el.classList.contains('owner-' + ui.escapedClientId())) {
return
}
let s = el.outerHTML
// console.log("Deserialized", el.id, el.classList)
layer_ui.svg(s)
Expand Down