diff --git a/src/components/overlaypanel/OverlayPanel.vue b/src/components/overlaypanel/OverlayPanel.vue index 34f8ea552..8ffe1d093 100644 --- a/src/components/overlaypanel/OverlayPanel.vue +++ b/src/components/overlaypanel/OverlayPanel.vue @@ -4,6 +4,9 @@
+ @@ -14,6 +17,14 @@ import DomHandler from '../utils/DomHandler'; export default { props: { appendTo: String, + showCloseIcon: { + type: Boolean, + default: false + }, + dismissable: { + type: Boolean, + default: true + }, baseZIndex: { type: Number, default: 0 @@ -32,7 +43,9 @@ export default { outsideClickListener: null, beforeDestroy() { this.restoreAppend(); - this.unbindOutsideClickListener(); + if (this.dismissable) { + this.unbindOutsideClickListener(); + } this.target = null; }, methods: { @@ -52,14 +65,19 @@ export default { onEnter() { this.appendContainer(); this.alignOverlay(); - this.bindOutsideClickListener(); + + if (this.dismissable) { + this.bindOutsideClickListener(); + } if (this.autoZIndex) { this.$refs.container.style.zIndex = String(this.baseZIndex + DomHandler.generateZIndex()); } }, onLeave() { - this.unbindOutsideClickListener(); + if (this.dismissable) { + this.unbindOutsideClickListener(); + } }, alignOverlay() { DomHandler.absolutePosition(this.$refs.container, this.target); diff --git a/src/views/overlaypanel/OverlayPanelDemo.vue b/src/views/overlaypanel/OverlayPanelDemo.vue index 3e78f3ae6..b179b56d4 100644 --- a/src/views/overlaypanel/OverlayPanelDemo.vue +++ b/src/views/overlaypanel/OverlayPanelDemo.vue @@ -10,7 +10,7 @@