Skip to content

Commit

Permalink
feat: Added modalLocked prop to ModalV2
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Akpa committed Jun 22, 2020
1 parent 34980f6 commit 4c6f747
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dev/views/Modals.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
</template>
</modal-v2>

<modal-v2 v-model="modal4" width="80%" fixed>
<modal-v2 v-model="modal4" width="80%" fixed :modal-locked="false">
<search32 slot="headingIcon" />

<template slot="heading">
Expand Down
23 changes: 19 additions & 4 deletions src/components/FishTankModalV2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ export default class FishTankModalV2 extends mixins(Detachable) {
})
overflow:string
/**
* Modal content overflow
*/
@Prop({
type:Boolean,
required: false,
default: true
})
modalLocked:boolean
// Data
overlayTransitionDuration = 650 // transition (500) + delay (150)
isActive = false
Expand Down Expand Up @@ -171,10 +181,14 @@ export default class FishTankModalV2 extends mixins(Detachable) {
}
updateState() {
if (this.active) {
document.body.classList.add('ft-modal-locked')
if (this.modalLocked === true){
document.body.classList.add('ft-modal-locked')
}
this.show()
} else {
document.body.classList.remove('ft-modal-locked')
if (this.modalLocked === true){
document.body.classList.remove('ft-modal-locked')
}
this.hide()
}
}
Expand Down Expand Up @@ -226,8 +240,9 @@ export default class FishTankModalV2 extends mixins(Detachable) {
if (!overlay) {
return this.showScroll()
}
document.body.classList.remove('ft-modal-locked')
if(document.body.classList.contains('ft-modal-locked')){
document.body.classList.remove('ft-modal-locked')
}
overlay.classList.remove('ft-overlay--active')
overlayTimeout = window.setTimeout(() => {
Expand Down

0 comments on commit 4c6f747

Please sign in to comment.