Return all widths and heights in the resize done event.
This commit is contained in:
@@ -123,17 +123,28 @@ class TpVSplitter extends LitElement {
|
||||
document.body.style['userSelect'] = '';
|
||||
this.dragging = false;
|
||||
|
||||
let finalWidth;
|
||||
let finalLeftWidth;
|
||||
if (this.lateResize && this._bufferedDelta) {
|
||||
finalWidth = this._leftWidth + this._bufferedDelta;
|
||||
finalLeftWidth = this._leftWidth + this._bufferedDelta;
|
||||
this.splitter.style.transform = '';
|
||||
this.style.gridTemplateColumns = `${finalWidth}px 5px 1fr`;
|
||||
this.style.gridTemplateColumns = `${finalLeftWidth}px 5px 1fr`;
|
||||
this._bufferedDelta = 0;
|
||||
} else {
|
||||
finalWidth = this.left.offsetWidth;
|
||||
finalLeftWidth = this.left.offsetWidth;
|
||||
}
|
||||
|
||||
this.dispatchEvent(new CustomEvent('resize-done', { detail: finalWidth, bubbles: true, composed: true }));
|
||||
// Calculate right width
|
||||
const splitterWidth = parseInt(getComputedStyle(this).getPropertyValue('--tp-splitter-width')) || 5;
|
||||
const finalRightWidth = this.offsetWidth - finalLeftWidth - splitterWidth;
|
||||
|
||||
this.dispatchEvent(new CustomEvent('resize-done', {
|
||||
detail: {
|
||||
leftWidth: finalLeftWidth,
|
||||
rightWidth: finalRightWidth
|
||||
},
|
||||
bubbles: true,
|
||||
composed: true
|
||||
}));
|
||||
}
|
||||
|
||||
_resize(e) {
|
||||
|
||||
Reference in New Issue
Block a user