File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/components/breadcrumb Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 11
11
</template >
12
12
13
13
<script setup lang="ts">
14
+ import { useEventListener } from ' @vueuse/core'
14
15
import Breadcrumb from ' primevue/breadcrumb'
15
16
import type { MenuItem , MenuItemCommandEvent } from ' primevue/menuitem'
16
17
import { computed } from ' vue'
@@ -52,6 +53,18 @@ const home = computed(() => ({
52
53
const handleItemClick = (event : MenuItemCommandEvent ) => {
53
54
event .item .command ?.(event )
54
55
}
56
+
57
+ // Escape exits from the current subgraph.
58
+ useEventListener (document , ' keydown' , (event ) => {
59
+ if (event .key === ' Escape' ) {
60
+ const canvas = useCanvasStore ().getCanvas ()
61
+ if (! canvas .graph ) throw new TypeError (' Canvas has no graph' )
62
+
63
+ canvas .setGraph (
64
+ navigationStore .navigationStack .at (- 2 ) ?? canvas .graph .rootGraph
65
+ )
66
+ }
67
+ })
55
68
</script >
56
69
57
70
<style >
You can’t perform that action at this time.
0 commit comments