Refactor #3965 - Update for unstyled check and data-* attributes

This commit is contained in:
Tuğçe Küçükoğlu 2023-06-09 15:44:26 +03:00
parent 66b08abf06
commit 350d5c21a7
10 changed files with 64 additions and 21 deletions

View file

@ -78,7 +78,7 @@ export default {
},
onBeforeLeave() {
if (this.modal) {
DomHandler.addClass(this.mask, 'p-component-overlay-leave');
!this.isUnstyled && DomHandler.addClass(this.mask, 'p-component-overlay-leave');
}
},
onLeave() {
@ -121,14 +121,16 @@ export default {
}
if (this.blockScroll) {
DomHandler.addClass(document.body, 'p-overflow-hidden');
document.body.setAttribute('data-p-overflow-hidden', 'true');
!this.isUnstyled && DomHandler.addClass(document.body, 'p-overflow-hidden');
}
},
disableDocumentSettings() {
this.unbindOutsideClickListener();
if (this.blockScroll) {
DomHandler.removeClass(document.body, 'p-overflow-hidden');
document.body.setAttribute('data-p-overflow-hidden', 'false');
!this.isUnstyled && DomHandler.removeClass(document.body, 'p-overflow-hidden');
}
},
onKeydown(event) {