42 lines
1.0 KiB
Plaintext
42 lines
1.0 KiB
Plaintext
private async inlineDialog(curValue: string, left: number, top: number): Promise<string> {
|
|
const target = this.elementRef.nativeElement.querySelector(
|
|
'.mat-tree-node'
|
|
);
|
|
const rect = target.getBoundingClientRect();
|
|
|
|
const clickEventY = this.groupMenuEvent.clientY;
|
|
const tartgetY = Math.floor((clickEventY - 150) * 0.1) * 10;
|
|
|
|
const dialogRef = this.dialog.open(EditInlineInputDialogComponent, {
|
|
width: rect.width,
|
|
height: rect.height,
|
|
panelClass: 'ucap-edit-group-name-dialog',
|
|
data: {
|
|
curValue,
|
|
left,
|
|
top
|
|
}
|
|
});
|
|
|
|
dialogRef
|
|
.afterClosed()
|
|
.pipe(
|
|
take(1),
|
|
map((result) => {
|
|
|
|
if (
|
|
!!result &&
|
|
result.choice &&
|
|
result.curValue.localeCompare(curValue) !== 0
|
|
) {
|
|
|
|
return result.curValue;
|
|
}
|
|
return '';
|
|
}),
|
|
catchError((err) => {
|
|
return of(err);
|
|
})
|
|
)
|
|
.subscribe();
|
|
} |