aboutsummaryrefslogtreecommitdiff
path: root/src/components/modal/modal.vue
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-06-17 11:23:32 +0300
committerShpuld Shpuldson <shp@cock.li>2020-06-17 11:23:32 +0300
commitf8cf92a01f952f344ee4c3b7df153b2ffdb7988f (patch)
treed1f20bc99722d2b94aeef772acd59083145d71ac /src/components/modal/modal.vue
parent064b59812c715d60526727d42c124375a2bc89d5 (diff)
parent57626c125d0477716a638854c4243ee0fde96923 (diff)
Merge branch 'develop' into kPherox/pleroma-fe-iss-149/profile-fields-display
Diffstat (limited to 'src/components/modal/modal.vue')
-rw-r--r--src/components/modal/modal.vue31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue
index cee24241..2b58913f 100644
--- a/src/components/modal/modal.vue
+++ b/src/components/modal/modal.vue
@@ -1,8 +1,9 @@
<template>
<div
v-show="isOpen"
- v-body-scroll-lock="isOpen"
+ v-body-scroll-lock="isOpen && !noBackground"
class="modal-view"
+ :class="classes"
@click.self="$emit('backdropClicked')"
>
<slot />
@@ -15,6 +16,18 @@ export default {
isOpen: {
type: Boolean,
default: true
+ },
+ noBackground: {
+ type: Boolean,
+ default: false
+ }
+ },
+ computed: {
+ classes () {
+ return {
+ 'modal-background': !this.noBackground,
+ 'open': this.isOpen
+ }
}
}
}
@@ -32,12 +45,22 @@ export default {
justify-content: center;
align-items: center;
overflow: auto;
+ pointer-events: none;
animation-duration: 0.2s;
- background-color: rgba(0, 0, 0, 0.5);
animation-name: modal-background-fadein;
+ opacity: 0;
+
+ > * {
+ pointer-events: initial;
+ }
+
+ &.modal-background {
+ pointer-events: initial;
+ background-color: rgba(0, 0, 0, 0.5);
+ }
- body:not(.scroll-locked) & {
- opacity: 0;
+ &.open {
+ opacity: 1;
}
}