feat(fe): minor cleanup of selection bubbles events

This commit is contained in:
Dimitrie Stefanescu
2022-09-02 12:24:02 +03:00
parent a4c20a64db
commit db4439ef85
@@ -246,22 +246,31 @@ export default {
window.addEventListener('beforeunload', async () => {
await this.sendDisconnect()
})
this.viewer.on(
'select',
ViewerEvent.ObjectDoubleClicked,
debounce((selectionInfo) => {
this.selectedIds = selectionInfo.userData.map((o) => o.id)
this.selectionLocation = selectionInfo.location
this.selectionCenter = selectionInfo.selectionCenter
this.sendUpdateAndPrune()
this.sendSelectionUpdate(selectionInfo)
}, 50)
)
this.viewer.on(
ViewerEvent.ObjectClicked,
debounce((selectionInfo) => {
this.sendSelectionUpdate(selectionInfo)
}, 50)
)
this.viewer.on(ViewerEvent.ObjectDoubleClicked, () => {})
},
async beforeDestroy() {
await this.sendDisconnect()
window.clearInterval(this.updateInterval)
},
methods: {
sendSelectionUpdate(selectionInfo) {
this.selectedIds = selectionInfo.userData.id
this.selectionLocation = selectionInfo.location
this.selectionCenter = selectionInfo.selectionCenter
this.sendUpdateAndPrune()
},
setUserPow(user) {
const camToSet = user.camera
if (camToSet[6] === 1) {