Skip to content

Commit

Permalink
fix(tooltip): fix tooltip with delay only appearing once (#2826)
Browse files Browse the repository at this point in the history
* fix(tooltip): fix tooltip with delay only appearing once

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml
  • Loading branch information
Ahtsham Raziq authored and valorkin committed Oct 18, 2017
1 parent ee7081d commit e625faa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sudo: false
language: node_js
node_js: "6"
node_js: "8"

notifications:
email: false
Expand Down Expand Up @@ -42,7 +42,7 @@ install:
- if [[ "$NGV" == "latest" ]]; then ./scripts/ci/npm-ng-latest.sh; fi
- if [[ "$NGV" == "next" ]]; then ./scripts/ci/npm-ng-next.sh; fi
- npm i ./dist > /dev/null
- if [[ "$TRAVIS_PULL_REQUEST" != false ]]; then SAUCE_USERNAME=$SAUCE_USERNAME_PR; SAUCE_ACCESS_KEY=$SAUCE_ACCESS_KEY_PR; fi
- if [[ "$TRAVIS_PULL_REQUEST" != false ]]; then export SAUCE_USERNAME=$SAUCE_USERNAME_PR; export SAUCE_ACCESS_KEY=$SAUCE_ACCESS_KEY_PR; fi

jobs:
fast_finish: true
Expand Down
7 changes: 6 additions & 1 deletion src/tooltip/tooltip.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ export class TooltipDirective implements OnInit, OnDestroy {
return;
}

const showTooltip = () =>
const showTooltip = () => {
if (this._delayTimeoutId) {
this._delayTimeoutId = undefined;
}

this._tooltip
.attach(TooltipContainerComponent)
.to(this.container)
Expand All @@ -234,6 +238,7 @@ export class TooltipDirective implements OnInit, OnDestroy {
placement: this.placement,
containerClass: this.containerClass
});
}

if (this._delay) {
this._delayTimeoutId = setTimeout(() => {
Expand Down

0 comments on commit e625faa

Please sign in to comment.