mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 17:30:14 +02:00
Merge pull request #44 from BrhmDev/fix/wrong-resizing-after-removing-splitview-nodes
Fix weird resizing after removing tab from split.
This commit is contained in:
commit
7b518c9243
1 changed files with 13 additions and 2 deletions
|
@ -160,8 +160,19 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
|
||||||
const leftOverChild = parent.children[0];
|
const leftOverChild = parent.children[0];
|
||||||
leftOverChild.sizeInParent = parent.sizeInParent;
|
leftOverChild.sizeInParent = parent.sizeInParent;
|
||||||
if (parent.parent) {
|
if (parent.parent) {
|
||||||
leftOverChild.parent = parent.parent;
|
const idx = parent.parent.children.indexOf(parent);
|
||||||
parent.parent.children[parent.parent.children.indexOf(parent)] = leftOverChild;
|
if (parent.parent.direction !== leftOverChild.direction) {
|
||||||
|
leftOverChild.parent = parent.parent;
|
||||||
|
parent.parent.children[idx] = leftOverChild;
|
||||||
|
} else {
|
||||||
|
// node cannot have same direction as it's parent
|
||||||
|
leftOverChild.children.forEach(c => {
|
||||||
|
c.sizeInParent *= leftOverChild.sizeInParent / 100
|
||||||
|
c.parent = parent.parent;
|
||||||
|
});
|
||||||
|
parent.parent.children.splice(idx, 1, ...leftOverChild.children);
|
||||||
|
this._removeNodeSplitters(leftOverChild, false);
|
||||||
|
}
|
||||||
this._removeNodeSplitters(parent, false);
|
this._removeNodeSplitters(parent, false);
|
||||||
return parent.parent;
|
return parent.parent;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue