Skip to content

Commit

Permalink
Keep size when move tab to new window
Browse files Browse the repository at this point in the history
  • Loading branch information
seong889 committed Nov 3, 2022
1 parent 36b9823 commit 67ef872
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions es/Algorithm.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ export function converToPanel(source) {
}
else {
let newPanel = { tabs: [source], group: source.group, activeId: source.id };
if (source.parent && 'tabs' in source.parent) {
let { x, y, w, h } = source.parent;
newPanel = Object.assign(Object.assign({}, newPanel), { x, y, w, h });
}
source.parent = newPanel;
return newPanel;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/Algorithm.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ function converToPanel(source) {
}
else {
let newPanel = { tabs: [source], group: source.group, activeId: source.id };
if (source.parent && 'tabs' in source.parent) {
let { x, y, w, h } = source.parent;
newPanel = Object.assign(Object.assign({}, newPanel), { x, y, w, h });
}
source.parent = newPanel;
return newPanel;
}
Expand Down
4 changes: 4 additions & 0 deletions src/Algorithm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ export function converToPanel(source: TabData | PanelData): PanelData {
return source;
} else {
let newPanel: PanelData = {tabs: [source], group: source.group, activeId: source.id};
if(source.parent && 'tabs' in source.parent) {
let {x, y, w, h} = source.parent;
newPanel = {...newPanel, x, y, w, h};
}
source.parent = newPanel;
return newPanel;
}
Expand Down

0 comments on commit 67ef872

Please sign in to comment.