feat: Add support for right click context menu in conversations (#4923)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
parent
d57dc41cee
commit
2082409657
13 changed files with 564 additions and 24 deletions
53
app/javascript/dashboard/components/ui/ContextMenu.vue
Normal file
53
app/javascript/dashboard/components/ui/ContextMenu.vue
Normal file
|
@ -0,0 +1,53 @@
|
|||
<template>
|
||||
<div
|
||||
v-show="show"
|
||||
ref="context"
|
||||
class="context-menu-container"
|
||||
:style="style"
|
||||
tabindex="0"
|
||||
@blur="$emit('close')"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
x: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
y: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
left: this.x,
|
||||
top: this.y,
|
||||
show: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
style() {
|
||||
return {
|
||||
top: this.top + 'px',
|
||||
left: this.left + 'px',
|
||||
};
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => this.$el.focus());
|
||||
this.show = true;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.context-menu-container {
|
||||
position: fixed;
|
||||
z-index: var(--z-index-very-high);
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue