pull/411/head
Merve Özçifçi 2020-07-24 11:52:12 +03:00
parent 562dee95b0
commit 458a9faffc
1 changed files with 37 additions and 21 deletions

View File

@ -1258,7 +1258,7 @@ export default {
if (!this.mask) {
this.mask = document.createElement('div');
this.mask.style.zIndex = String(parseInt(this.$refs.overlay.style.zIndex, 10) - 1);
DomHandler.addMultipleClasses(this.mask, 'p-component-overlay p-datepicker-mask p-datepicker-mask-scrollblocker');
DomHandler.addMultipleClasses(this.mask, 'p-datepicker-mask p-datepicker-mask-scrollblocker');
this.maskClickListener = () => {
this.disableModality();
@ -1267,10 +1267,18 @@ export default {
document.body.appendChild(this.mask);
DomHandler.addClass(document.body, 'p-overflow-hidden');
setTimeout(() => {
DomHandler.addClass(this.mask, 'p-component-overlay');
}, 1);
}
},
disableModality() {
if (this.mask) {
this.overlayVisible = false;
DomHandler.addClass(this.mask, 'p-datepicker-mask-leave');
this.mask.addEventListener('transitionend', () => {
this.mask.removeEventListener('click', this.maskClickListener);
this.maskClickListener = null;
document.body.removeChild(this.mask);
@ -1289,8 +1297,7 @@ export default {
if (!hasBlockerMasks) {
DomHandler.removeClass(document.body, 'p-overflow-hidden');
}
this.overlayVisible = false;
});
}
},
updateCurrentMetaData() {
@ -2291,4 +2298,13 @@ export default {
min-width: 80vw;
transform: translate(-50%, -50%);
}
.p-datepicker-mask {
background-color: transparent;
transition-property: background-color;
}
.p-datepicker-mask.p-datepicker-mask-leave.p-component-overlay {
background-color: transparent;
}
</style>