aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/components/tooltip
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-06-17 22:40:44 +0300
committerMichael Lando <ml636r@att.com>2017-06-18 07:20:49 +0300
commit4d97d5fac309ce0d66938e5ccd0349e2660d4e23 (patch)
tree3f921054f997d1962fa6f9db9a0119e31a851eea /catalog-ui/src/app/ng2/components/tooltip
parent89786d31f266a205857cae0177904c249ac6a512 (diff)
[sdc] update code of sdc
Change-Id: If9f37c80b659cb67b34d18e6c019defecca58b9a Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/components/tooltip')
-rw-r--r--catalog-ui/src/app/ng2/components/tooltip/tooltip.component.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/catalog-ui/src/app/ng2/components/tooltip/tooltip.component.ts b/catalog-ui/src/app/ng2/components/tooltip/tooltip.component.ts
index e98b69003e..891aa60860 100644
--- a/catalog-ui/src/app/ng2/components/tooltip/tooltip.component.ts
+++ b/catalog-ui/src/app/ng2/components/tooltip/tooltip.component.ts
@@ -14,6 +14,7 @@ export class TooltipComponent {
private tooltip: ComponentRef<TooltipContentComponent>;
private visible: boolean;
+ private delayInProgress: boolean = false;
// -------------------------------------------------------------------------
// Constructor
@@ -31,6 +32,7 @@ export class TooltipComponent {
@Input() tooltipDisabled: boolean;
@Input() tooltipAnimation: boolean = true;
@Input() tooltipPlacement: "top"|"bottom"|"left"|"right" = "bottom";
+ @Input() tooltipDelay: number = 1500;
// -------------------------------------------------------------------------
// Public Methods
@@ -41,6 +43,11 @@ export class TooltipComponent {
if(this.tooltipDisabled || this.visible || this.content === "") {
return;
}
+ if (this.tooltipDelay && !this.delayInProgress) {
+ this.delayInProgress = true;
+ setTimeout(() => { this.delayInProgress && this.show() }, this.tooltipDelay);
+ return;
+ }
this.visible = true;
if (typeof this.content === "string") {
@@ -65,6 +72,7 @@ export class TooltipComponent {
@HostListener("mouseleave")
hide(): void {
+ this.delayInProgress = false;
if (!this.visible) {
return;
}