BlockUI: data-pc-section added for mask

pull/4239/head
Tuğçe Küçükoğlu 2023-08-03 16:51:15 +03:00
parent 53654dd82d
commit 46b0dfb92c
1 changed files with 10 additions and 9 deletions

View File

@ -33,23 +33,24 @@ export default {
block() { block() {
let styleClass = 'p-blockui p-component-overlay p-component-overlay-enter'; let styleClass = 'p-blockui p-component-overlay p-component-overlay-enter';
this.mask = document.createElement('div');
this.mask.setAttribute('data-pc-section', 'mask');
DomHandler.addStyles(this.mask, {
position: 'absolute',
top: '0',
left: '0',
width: '100%',
height: '100%'
});
if (this.fullScreen) { if (this.fullScreen) {
styleClass += ' p-blockui-document'; styleClass += ' p-blockui-document';
this.mask = document.createElement('div');
!this.isUnstyled && this.mask.setAttribute('class', styleClass); !this.isUnstyled && this.mask.setAttribute('class', styleClass);
document.body.appendChild(this.mask); document.body.appendChild(this.mask);
DomHandler.addClass(document.body, 'p-overflow-hidden'); DomHandler.addClass(document.body, 'p-overflow-hidden');
document.activeElement.blur(); document.activeElement.blur();
} else { } else {
this.mask = document.createElement('div');
!this.isUnstyled && this.mask.setAttribute('class', styleClass); !this.isUnstyled && this.mask.setAttribute('class', styleClass);
DomHandler.addStyles(this.mask, {
position: 'absolute',
top: '0',
left: '0',
width: '100%',
height: '100%'
});
this.$refs.container.appendChild(this.mask); this.$refs.container.appendChild(this.mask);
} }