mirror of
https://github.com/mathuo/dockview
synced 2025-05-06 19:48:25 +00:00
Merge pull request #864 from dqhieuu/master
Make `id` option in addGroup without referenceGroup/referencePanel work
This commit is contained in:
commit
d086dfd081
@ -1131,7 +1131,7 @@ export class DockviewComponent
|
|||||||
this.updateWatermark();
|
this.updateWatermark();
|
||||||
}
|
}
|
||||||
|
|
||||||
private orthogonalize(position: Position): DockviewGroupPanel {
|
private orthogonalize(position: Position, options?: GroupOptions): DockviewGroupPanel {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case 'top':
|
case 'top':
|
||||||
case 'bottom':
|
case 'bottom':
|
||||||
@ -1157,10 +1157,10 @@ export class DockviewComponent
|
|||||||
case 'top':
|
case 'top':
|
||||||
case 'left':
|
case 'left':
|
||||||
case 'center':
|
case 'center':
|
||||||
return this.createGroupAtLocation([0]); // insert into first position
|
return this.createGroupAtLocation([0], undefined, options); // insert into first position
|
||||||
case 'bottom':
|
case 'bottom':
|
||||||
case 'right':
|
case 'right':
|
||||||
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
||||||
default:
|
default:
|
||||||
throw new Error(`unsupported position ${position}`);
|
throw new Error(`unsupported position ${position}`);
|
||||||
}
|
}
|
||||||
@ -1835,7 +1835,8 @@ export class DockviewComponent
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const group = this.orthogonalize(
|
const group = this.orthogonalize(
|
||||||
directionToPosition(<Direction>options.direction)
|
directionToPosition(<Direction>options.direction),
|
||||||
|
options
|
||||||
);
|
);
|
||||||
if (!options.skipSetActive) {
|
if (!options.skipSetActive) {
|
||||||
this.doSetGroupAndPanelActive(group);
|
this.doSetGroupAndPanelActive(group);
|
||||||
@ -2503,9 +2504,10 @@ export class DockviewComponent
|
|||||||
|
|
||||||
private createGroupAtLocation(
|
private createGroupAtLocation(
|
||||||
location: number[],
|
location: number[],
|
||||||
size?: number
|
size?: number,
|
||||||
|
options?: GroupOptions
|
||||||
): DockviewGroupPanel {
|
): DockviewGroupPanel {
|
||||||
const group = this.createGroup();
|
const group = this.createGroup(options);
|
||||||
this.doAddGroup(group, location, size);
|
this.doAddGroup(group, location, size);
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user