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 4659091
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions es/Algorithm.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ export function converToPanel(source) {
}
else {
let newPanel = { tabs: [source], group: source.group, activeId: source.id };
if (source.parent && 'tabs' in source.parent) {
newPanel.x = source.parent.x;
newPanel.y = source.parent.y;
newPanel.w = source.parent.w;
newPanel.h = source.parent.h;
}
source.parent = newPanel;
return newPanel;
}
Expand Down
6 changes: 6 additions & 0 deletions lib/Algorithm.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ function converToPanel(source) {
}
else {
let newPanel = { tabs: [source], group: source.group, activeId: source.id };
if (source.parent && 'tabs' in source.parent) {
newPanel.x = source.parent.x;
newPanel.y = source.parent.y;
newPanel.w = source.parent.w;
newPanel.h = source.parent.h;
}
source.parent = newPanel;
return newPanel;
}
Expand Down
6 changes: 6 additions & 0 deletions src/Algorithm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ 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) {
newPanel.x = source.parent.x
newPanel.y = source.parent.y
newPanel.w = source.parent.w
newPanel.h = source.parent.h
}
source.parent = newPanel;
return newPanel;
}
Expand Down

0 comments on commit 4659091

Please sign in to comment.