Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
[nzMinHeight]="250"
[nzMaxWidth]="window.innerWidth"
[nzMaxHeight]="window.innerHeight"
[style.top.px]="-defaultHeight"
[style.width.px]="width"
[style.height.px]="height"
(nzResize)="onResize($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

#result-container {
position: absolute;
top: -300px;
left: 0;
background: white;
border-radius: 5px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,13 @@ describe("ResultPanelComponent", () => {
el.triggerEventHandler(event, payload);
};

// The return position is computed against the default height. Docked a different distance
// above the workspace's edge, a panel opened at that height runs off the bottom of the window.
it("docks the panel one default height above the workspace's bottom edge", () => {
const container: HTMLElement = fixture.debugElement.query(By.css("#result-container")).nativeElement;
expect(container.style.top).toBe(`-${DEFAULT_HEIGHT}px`);
});

it("renders the docked panel chrome and wires the close / reset actions", () => {
component.width = DEFAULT_WIDTH;
fixture.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export class ResultPanelComponent implements OnInit, OnDestroy {
componentOutlets!: ElementRef;
frameComponentConfigs: Map<string, { component: Type<any>; componentInputs: {} }> = new Map();
protected readonly window = window;
// The docked panel sits this far above the workspace's bottom edge. The return position is
// computed against the default height, so the two have to be the same number.
protected readonly defaultHeight = DEFAULT_HEIGHT;
id = -1;
width = DEFAULT_WIDTH;
height = DEFAULT_HEIGHT;
Expand Down
Loading