aboutsummaryrefslogtreecommitdiff
path: root/src/components/AncestryBar.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-05-23 07:48:23 +1000
committerTerry Truong <terry06890@gmail.com>2022-05-23 07:48:23 +1000
commit1cc68d15ebdd1a2b9d3eb1314d5d88765e52fc76 (patch)
treec4369683942db2a8e7ab910ff2ba594bc2dbf563 /src/components/AncestryBar.vue
parent19984e11e3bfd793188fd84c621a304330f4a303 (diff)
Enable vertical wheel-scroll on horizontal ancestry bar
Diffstat (limited to 'src/components/AncestryBar.vue')
-rw-r--r--src/components/AncestryBar.vue10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components/AncestryBar.vue b/src/components/AncestryBar.vue
index 5419f78..2dd19fb 100644
--- a/src/components/AncestryBar.vue
+++ b/src/components/AncestryBar.vue
@@ -73,7 +73,13 @@ export default defineComponent({
},
onInfoIconClick(data: string){
this.$emit('info-icon-click', data);
- }
+ },
+ onWheelEvt(evt: WheelEvent){
+ // Possibly convert vertical scroll to horizontal
+ if (this.wideArea && Math.abs(evt.deltaX) < Math.abs(evt.deltaY)){
+ this.$el.scrollLeft -= (evt.deltaY > 0 ? 30 : -30);
+ }
+ },
},
components: {Tile, },
emits: ['detached-ancestor-click', 'info-icon-click', ],
@@ -81,7 +87,7 @@ export default defineComponent({
</script>
<template>
-<div :style="styles">
+<div :style="styles" @wheel.stop="onWheelEvt">
<tile v-for="(node, idx) in usedNodes" :key="node.name" class="shrink-0"
:layoutNode="node" :tolMap="tolMap" :nonAbsPos="true" :lytOpts="lytOpts" :uiOpts="uiOpts"
@leaf-click="onTileClick(nodes[idx])" @info-icon-click="onInfoIconClick"/>