mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Fixed #4589 - Improve block/unblockScroll architecture
This commit is contained in:
parent
b85876be95
commit
4fa7741923
9 changed files with 36 additions and 43 deletions
|
@ -93,8 +93,7 @@ export default {
|
|||
},
|
||||
onImageClick() {
|
||||
if (this.preview) {
|
||||
DomHandler.addClass(document.body, 'p-overflow-hidden');
|
||||
document.body.style.setProperty('--scrollbar-width', DomHandler.calculateScrollbarWidth() + 'px');
|
||||
DomHandler.blockBodyScroll();
|
||||
this.maskVisible = true;
|
||||
setTimeout(() => {
|
||||
this.previewVisible = true;
|
||||
|
@ -164,8 +163,7 @@ export default {
|
|||
!this.isUnstyled && DomHandler.addClass(this.mask, 'p-component-overlay-leave');
|
||||
},
|
||||
onLeave() {
|
||||
DomHandler.removeClass(document.body, 'p-overflow-hidden');
|
||||
document.body.style.removeProperty('--scrollbar-width');
|
||||
DomHandler.unblockBodyScroll();
|
||||
this.$emit('hide');
|
||||
},
|
||||
onAfterLeave(el) {
|
||||
|
@ -183,8 +181,7 @@ export default {
|
|||
this.previewVisible = false;
|
||||
this.rotate = 0;
|
||||
this.scale = 1;
|
||||
DomHandler.removeClass(document.body, 'p-overflow-hidden');
|
||||
document.body.style.removeProperty('--scrollbar-width');
|
||||
DomHandler.unblockBodyScroll();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue