mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
fix: fix getComputedStyle error
This commit is contained in:
parent
47a20256ef
commit
5f15f6bb7e
1 changed files with 8 additions and 5 deletions
|
@ -322,24 +322,27 @@ export default {
|
|||
let leftPos = offset.left + deltaX;
|
||||
let topPos = offset.top + deltaY;
|
||||
let viewport = DomHandler.getViewport();
|
||||
let containerComputedStyle = getComputedStyle(this.container)
|
||||
let marginLeft = parseFloat(containerComputedStyle.marginLeft);
|
||||
let marginTop = parseFloat(containerComputedStyle.marginTop);
|
||||
|
||||
this.container.style.position = 'fixed';
|
||||
|
||||
if (this.keepInViewport) {
|
||||
if (leftPos >= this.minX && leftPos + width < viewport.width) {
|
||||
this.lastPageX = event.pageX;
|
||||
this.container.style.left = leftPos + 'px';
|
||||
this.container.style.left = (leftPos - marginLeft) + 'px';
|
||||
}
|
||||
|
||||
if (topPos >= this.minY && topPos + height < viewport.height) {
|
||||
this.lastPageY = event.pageY;
|
||||
this.container.style.top = topPos + 'px';
|
||||
this.container.style.top = (topPos - marginTop) + 'px';
|
||||
}
|
||||
} else {
|
||||
this.lastPageX = event.pageX;
|
||||
this.container.style.left = leftPos + 'px';
|
||||
this.container.style.left = (leftPos - marginLeft) + 'px';
|
||||
this.lastPageY = event.pageY;
|
||||
this.container.style.top = topPos + 'px';
|
||||
this.container.style.top = (topPos - marginTop) + 'px';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -369,7 +372,7 @@ export default {
|
|||
window.document.removeEventListener('mouseup', this.documentDragEndListener);
|
||||
this.documentDragEndListener = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
maximizeIconComponent() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue