diff --git a/src/components/overlaypanel/OverlayPanel.vue b/src/components/overlaypanel/OverlayPanel.vue index 947fd5c088..b2ce14c73d 100755 --- a/src/components/overlaypanel/OverlayPanel.vue +++ b/src/components/overlaypanel/OverlayPanel.vue @@ -58,6 +58,7 @@ export default { }, selfClick: false, target: null, + eventTarget: null, outsideClickListener: null, scrollHandler: null, resizeListener: null, @@ -94,15 +95,16 @@ export default { } }, methods: { - toggle(event) { + toggle(event, target) { if (this.visible) this.hide(); else - this.show(event); + this.show(event, target); }, - show(event) { + show(event, target) { this.visible = true; - this.target = event.currentTarget; + this.eventTarget = event.currentTarget; + this.target = target || event.currentTarget; }, hide() { this.visible = false; @@ -211,7 +213,7 @@ export default { } }, isTargetClicked(event) { - return this.target && (this.target === event.target || this.target.contains(event.target)); + return (this.eventTarget && (this.eventTarget === event.target || this.eventTarget.contains(event.target))); }, containerRef(el) { this.container = el; diff --git a/src/views/overlaypanel/OverlayPanelDoc.vue b/src/views/overlaypanel/OverlayPanelDoc.vue index e9f3cdc503..fc79848608 100755 --- a/src/views/overlaypanel/OverlayPanelDoc.vue +++ b/src/views/overlaypanel/OverlayPanelDoc.vue @@ -116,13 +116,14 @@ toggle(event) { toggle - event: Browser event + event: Browser event
+ target: Optional target if event.currentTarget should not be used Toggles the visibility of the overlay. show event: Browser event
- target: Optional target if event.target should not be used + target: Optional target if event.currentTarget should not be used Shows the overlay.