holiber/sl-vue-tree

show context menu on responsive web when button clicked. not by right click event nodecontextmenu

Opened this issue · 2 comments

show context menu on responsive web when button clicked. not by right click event nodecontextmenu

I am trying to use this tree, but I tried to show contextMenu when it has click side icon that I gave it.
right click to open context menu is working properly, but when I clicked bar to open context menu is not working. do you have any idea with it?

<template slot="sidebar" slot-scope="{ node }">
    <span class="visible-icon" style="padding:0px 3px 0px 10px; cursor:pointer" @click="event => showContextEllipsis(event, node)">
              <i  class="fa fa-ellipsis-v"></i>
            </span>
</template>

showContextEllipsis(event, node) {
this.showContextMenu(node, event, 'clicked')
},

showContextMenu(node, event, type) {
event.preventDefault();
this.contextMenuIsVisible = true;
const $contextMenu = this.$refs.contextmenu;
console.log('X: ' + event.clientX+ ' :Y: '+ event.clientY);
this.$refs.slVueTree.select(node.path);
$contextMenu.style.left = event.clientX + 'px';
$contextMenu.style.top = event.clientY + 'px';
},

Dun worry, I figured out, I was kinda stupid with this. haha