mirror of https://github.com/apache/nifi.git
NIFI-13855: Ensuring that tooltips get closed when the host component is clicked. (#9376)
This closes #9376
This commit is contained in:
parent
f3fcedc864
commit
3ab60859ea
|
@ -59,8 +59,35 @@ export class NifiTooltipDirective<T> implements OnDestroy {
|
|||
}
|
||||
}
|
||||
|
||||
@HostListener('mousemove')
|
||||
mouseMove() {
|
||||
if (this.overlayRef?.hasAttached() && this.tooltipDisabled) {
|
||||
this.overlayRef?.detach();
|
||||
|
||||
if (this.positionStrategy?.detach) {
|
||||
this.positionStrategy.detach();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@HostListener('mouseup')
|
||||
mouseup() {
|
||||
if (!this.overlayRef?.hasAttached()) {
|
||||
this.attach();
|
||||
}
|
||||
}
|
||||
|
||||
@HostListener('mouseleave')
|
||||
mouseLeave() {
|
||||
this.closeTip();
|
||||
}
|
||||
|
||||
@HostListener('click')
|
||||
click() {
|
||||
this.closeTip();
|
||||
}
|
||||
|
||||
private closeTip(): void {
|
||||
if (this.overlayRef?.hasAttached() && !this.overTip) {
|
||||
if (this.delayClose) {
|
||||
this.closeTimer = window.setTimeout(() => {
|
||||
|
@ -87,24 +114,6 @@ export class NifiTooltipDirective<T> implements OnDestroy {
|
|||
}
|
||||
}
|
||||
|
||||
@HostListener('mousemove')
|
||||
mouseMove() {
|
||||
if (this.overlayRef?.hasAttached() && this.tooltipDisabled) {
|
||||
this.overlayRef?.detach();
|
||||
|
||||
if (this.positionStrategy?.detach) {
|
||||
this.positionStrategy.detach();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@HostListener('mouseup')
|
||||
mouseup() {
|
||||
if (!this.overlayRef?.hasAttached()) {
|
||||
this.attach();
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.overlayRef?.dispose();
|
||||
this.positionStrategy?.dispose();
|
||||
|
|
Loading…
Reference in New Issue