diff --git a/src/components/field-key/new.vue b/src/components/field-key/new.vue
index 317298851..afb90681d 100644
--- a/src/components/field-key/new.vue
+++ b/src/components/field-key/new.vue
@@ -41,7 +41,7 @@ except according to the terms contained in the LICENSE file.
{{ $t('success[0]', created) }}
-
+
{{ $t('success[1]', created) }}
diff --git a/src/components/popover.vue b/src/components/popover.vue
index f9bc17e9b..9ffced1f5 100644
--- a/src/components/popover.vue
+++ b/src/components/popover.vue
@@ -74,11 +74,13 @@ export default {
// not show, then hide), we use event capturing here.
document.addEventListener('click', this.hideAfterClick, true);
window.addEventListener('resize', this.hideAfterResize);
+ document.addEventListener('keydown', this.hideAfterEsc);
},
beforeUnmount() {
if (this.target != null) this.hide();
document.removeEventListener('click', this.hideAfterClick, true);
window.removeEventListener('resize', this.hideAfterResize);
+ document.removeEventListener('keydown', this.hideAfterEsc);
},
methods: {
show() {
@@ -108,12 +110,16 @@ export default {
this.show();
},
hideAfterClick(event) {
- if (this.target != null && event.target.closest('.popover') == null &&
- !this.target.contains(event.target))
+ if (this.target != null &&
+ ((event.target.closest('.popover') == null && !this.target.contains(event.target)) ||
+ (event.target.hasAttribute('data-closes-popover'))))
this.$emit('hide');
},
hideAfterResize() {
if (this.target != null) this.$emit('hide');
+ },
+ hideAfterEsc({ key }) {
+ if (this.target != null && key === 'Escape') this.$emit('hide');
}
}
};
diff --git a/src/components/qr-panel.vue b/src/components/qr-panel.vue
index 23bd8b072..53df8746b 100644
--- a/src/components/qr-panel.vue
+++ b/src/components/qr-panel.vue
@@ -15,7 +15,12 @@ except according to the terms contained in the LICENSE file.
-
+
+
+
+
@@ -23,6 +28,12 @@ except according to the terms contained in the LICENSE file.
defineOptions({
name: 'QrPanel'
});
+defineProps({
+ showClose: {
+ type: Boolean,
+ default: true
+ }
+});