Commit 635433a1 by xhw

线段连接

parent 22b6446a
......@@ -174,10 +174,16 @@ function getXY(e, obj) {
function handleContextmenu(e) {
const customMenu = document.getElementById('customContextMenu');
// 阻止默认右键菜单
e.preventDefault();
e.preventDefault()
e.stopPropagation()
console.log(e)
//判断当前的线段关闭功能是否显示
if(document.getElementsByClassName('drawflow-delete').length > 0){
document.getElementById('customContextMenu').style.display = 'none';
return
}
const customMenu = document.getElementById('customContextMenu');
// 显示自定义菜单
customMenu.style.display = 'block';
......@@ -282,6 +288,7 @@ function rightMenu() {
// 阻止在菜单上右键点击时触发默认菜单
customMenu.addEventListener('contextmenu', (e) => {
e.preventDefault();
e.stopPropagation();
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment