aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-03-23 18:54:37 +1100
committerTerry Truong <terry06890@gmail.com>2022-03-23 19:01:36 +1100
commit7ca13b43410364a4ac3bd109e3215a7c26814b93 (patch)
tree6b96fdd6b094b29e6353a884eeb275fb2ad64947 /src/components
parent0b736a9df79b5ab88e40858e5f94a32d141a76ba (diff)
Prevent double-clicks from highlighting text
Diffstat (limited to 'src/components')
-rw-r--r--src/components/TileTree.vue8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/components/TileTree.vue b/src/components/TileTree.vue
index f007935..c6f0061 100644
--- a/src/components/TileTree.vue
+++ b/src/components/TileTree.vue
@@ -176,6 +176,12 @@ export default defineComponent({
this.activeRoot = layoutNode;
tryLayout(layoutNode, this.tileAreaPos, this.tileAreaDims, this.layoutOptions, true);
},
+ // For preventing double-clicks from highlighting text
+ onMouseDown(evt: Event){
+ if (evt.detail == 2){
+ evt.preventDefault();
+ }
+ },
},
created(){
tryLayout(this.activeRoot, this.tileAreaPos, this.tileAreaDims, this.layoutOptions, true);
@@ -188,7 +194,7 @@ export default defineComponent({
</script>
<template>
-<div :style="styles">
+<div :style="styles" @mousedown="onMouseDown">
<tile :layoutNode="layoutTree"
:headerSz="layoutOptions.headerSz" :tileSpacing="layoutOptions.tileSpacing" :options="componentOptions"
@leaf-clicked="onInnerLeafClicked" @header-clicked="onInnerHeaderClicked"