aboutsummaryrefslogtreecommitdiff
path: root/src/components/modal/modal.vue
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2020-06-06 21:24:47 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2020-06-06 21:24:47 +0000
commita5de8db579f6c50c1bbe5659e82bc29eaa588e7f (patch)
tree9ab84c6012e3cb68484514920817862b91f1c25d /src/components/modal/modal.vue
parente47d0f210317c6e04e15fb89eb8f1d469137b779 (diff)
parent68482fd3a6870514c7e8bd0fe433f24711e97ce9 (diff)
Merge branch 'settings-modal' into 'develop'
Settings modal See merge request pleroma/pleroma-fe!1118
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;
}
}