Skip to content

Commit

Permalink
Fixed #118 - ContextMenu fails in global mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Dec 20, 2019
1 parent ed694b0 commit d88d194
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/components/contextmenu/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export default {
this.unbindOutsideClickListener();
this.unbindDocumentContextMenuListener();
},
mounted() {
if (this.global) {
this.bindDocumentContextMenuListener();
}
},
methods: {
itemClick(event) {
const item = event.item;
Expand Down Expand Up @@ -89,21 +94,13 @@ export default {
this.bindOutsideClickListener();
this.bindResizeListener();
if (this.global) {
this.bindDocumentContextMenuListener();
}
if (this.autoZIndex) {
this.$refs.container.style.zIndex = String(this.baseZIndex + DomHandler.generateZIndex());
}
},
onLeave() {
this.unbindOutsideClickListener();
this.unbindResizeListener();
if (this.global) {
this.unbindDocumentContextMenuListener();
}
},
position() {
let left = this.pageX + 1;
Expand Down

0 comments on commit d88d194

Please sign in to comment.