Skip to content

Commit c9d4b91

Browse files
committed
unmount listeners (#16)
1 parent ce21e69 commit c9d4b91

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iyp-browser",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"private": true,
55
"type": "module",
66
"scripts": {

src/components/InputPanel.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ onMounted(() => {
8383
updateEditorHeight()
8484
}
8585
})
86-
87-
window.addEventListener('hitResult', () => {
88-
// console.log(e)
89-
})
9086
monaco.languages.register({
9187
id: 'cypher',
9288
extensions: ['.cypher'],

src/components/OutputPanel.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { ref, inject, onMounted } from 'vue'
2+
import { ref, inject, onMounted, onUnmounted } from 'vue'
33
import InputPanel from '@/components/InputPanel.vue'
44
import GraphOutput from '@/components/output/GraphOutput.vue'
55
import TableOutput from '@/components/output/TableOutput.vue'
@@ -27,6 +27,7 @@ const isFullscreen = ref(false)
2727
const heightBeforeFullscreen = ref('')
2828
let previousEditorHeight = 0
2929
const expandedNodesState = ref(new Map())
30+
let interactOutputPanel = null
3031
3132
const runCypher = async (cypher) => {
3233
loading.value = true
@@ -110,7 +111,7 @@ const changeTab = (tabName) => {
110111
onMounted(() => {
111112
run(props.query)
112113
if (!props.disableResizer) {
113-
interact(outputPanel.value)
114+
interactOutputPanel = interact(outputPanel.value)
114115
.origin('self')
115116
.resizable({
116117
edges: { top: false, left: false, bottom: true, right: false },
@@ -129,6 +130,12 @@ onMounted(() => {
129130
})
130131
}
131132
})
133+
134+
onUnmounted(() => {
135+
if (interactOutputPanel) {
136+
interactOutputPanel.unset()
137+
}
138+
})
132139
</script>
133140

134141
<template>

src/components/output/GraphOutput.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const nodeRightClickMenu = ref({
3939
clicked: false
4040
})
4141
const graphOverviewPanelWidth = ref(`${GlobalVariables.graphOverviewPanelWidth}px`)
42+
let interactOverview = null
4243
4344
const options = {
4445
disableTelemetry: true,
@@ -409,7 +410,7 @@ const init = (nodes, relationships) => {
409410
onMounted(async () => {
410411
init(props.nodes, props.relationships)
411412
if (!props.disableResizer) {
412-
interact(overview.value)
413+
interactOverview = interact(overview.value)
413414
.origin('self')
414415
.resizable({
415416
edges: { top: false, left: true, bottom: false, right: false },
@@ -433,6 +434,9 @@ onUnmounted(() => {
433434
if (nvl) {
434435
nvl.destroy()
435436
}
437+
if (interactOverview) {
438+
interactOverview.unset()
439+
}
436440
})
437441
</script>
438442

0 commit comments

Comments
 (0)