Migrated BlockUI to V3

pull/496/head
Cagatay Civici 2020-09-23 15:41:42 +03:00
parent ac7ee76682
commit ca201d8e1d
1 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="p-blockui-container"> <div ref="container" class="p-blockui-container">
<slot></slot> <slot></slot>
</div> </div>
</template> </template>
@ -50,13 +50,10 @@ export default {
document.activeElement.blur(); document.activeElement.blur();
} }
else { else {
const target = this.$children ? this.$children[0]: null; debugger;
if (target) { this.mask = document.createElement('div');
this.mask = document.createElement('div'); this.mask.setAttribute('class', 'p-blockui');
this.mask.setAttribute('class', 'p-blockui'); this.$refs.container.appendChild(this.mask);
target.$el.appendChild(this.mask);
target.$el.style.position = 'relative';
}
} }
if (this.mask) { if (this.mask) {
@ -83,7 +80,7 @@ export default {
DomHandler.removeClass(document.body, 'p-overflow-hidden'); DomHandler.removeClass(document.body, 'p-overflow-hidden');
} }
else { else {
this.$children[0].$el.removeChild(this.mask); this.$refs.container.removeChild(this.mask);
} }
this.$emit('unblock'); this.$emit('unblock');
@ -93,6 +90,10 @@ export default {
</script> </script>
<style> <style>
.p-blockui-container {
position: relative;
}
.p-blockui { .p-blockui {
position: absolute; position: absolute;
top: 0; top: 0;