Skip to content

Commit

Permalink
fix: add blur background for opened alert
Browse files Browse the repository at this point in the history
  • Loading branch information
hassanpdn committed Feb 26, 2023
1 parent 659bc6e commit 5509e1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
14 changes: 12 additions & 2 deletions src/components/Alert/VAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,20 @@
}
},
mounted(){
document.querySelector('body').style.overflow = "hidden"
const bodyElement = document.querySelector("body");
bodyElement.style.overflow = "hidden";
bodyElement.classList.add = "blur-sm";
bodyElement.addEventListener('click', ()=> {
return false
})
},
beforeDestroy() {
document.querySelector('body').style.overflow = 'visible'
const bodyElement = document.querySelector("body");
bodyElement.style.overflow = "visible";
bodyElement.classList.remove = "blur-sm";
bodyElement.removeEventListener('click', ()=> {
return false
})
},
}
</script>
8 changes: 2 additions & 6 deletions src/components/Button/VButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
active:bg-green-800
transition-colors
transition-shadows
duration-500
duration-500
ease-linear"
:class="`${expanded ? 'w-full' : ''} ${bgColor} ${textColor} ${text}`"
:class="`${expanded ? 'w-full' : ''} ${bgColor} ${textColor}`"
@click="handleClick"
>
<slot/>
Expand All @@ -26,10 +26,6 @@
type: Boolean,
default: false
},
text: {
type: String,
default: ''
},
textColor: {
type: String,
default: 'bg-gray-300'
Expand Down

0 comments on commit 5509e1d

Please sign in to comment.