Fixed #4536 - ContextMenu: global property is not working

pull/4542/head
Tuğçe Küçükoğlu 2023-10-03 14:20:43 +03:00
parent 1827b6e9c9
commit 7c3218cef2
1 changed files with 1 additions and 5 deletions

View File

@ -71,11 +71,9 @@ export default {
if (ObjectUtils.isNotEmpty(newPath)) { if (ObjectUtils.isNotEmpty(newPath)) {
this.bindOutsideClickListener(); this.bindOutsideClickListener();
this.bindResizeListener(); this.bindResizeListener();
this.bindDocumentContextMenuListener();
} else if (!this.visible) { } else if (!this.visible) {
this.unbindOutsideClickListener(); this.unbindOutsideClickListener();
this.unbindResizeListener(); this.unbindResizeListener();
this.unbindDocumentContextMenuListener();
} }
} }
}, },
@ -358,7 +356,6 @@ export default {
onAfterEnter() { onAfterEnter() {
this.bindOutsideClickListener(); this.bindOutsideClickListener();
this.bindResizeListener(); this.bindResizeListener();
this.bindDocumentContextMenuListener();
this.$emit('show'); this.$emit('show');
DomHandler.focus(this.list); DomHandler.focus(this.list);
@ -374,7 +371,6 @@ export default {
this.unbindOutsideClickListener(); this.unbindOutsideClickListener();
this.unbindResizeListener(); this.unbindResizeListener();
this.unbindDocumentContextMenuListener();
}, },
position() { position() {
let left = this.pageX + 1; let left = this.pageX + 1;
@ -446,7 +442,7 @@ export default {
bindDocumentContextMenuListener() { bindDocumentContextMenuListener() {
if (!this.documentContextMenuListener) { if (!this.documentContextMenuListener) {
this.documentContextMenuListener = (event) => { this.documentContextMenuListener = (event) => {
event.button !== 2 ? this.show(event) : this.hide(); event.button === 2 && this.show(event);
}; };
document.addEventListener('contextmenu', this.documentContextMenuListener); document.addEventListener('contextmenu', this.documentContextMenuListener);