From e6be67e2cd73a874692492e5c77e0fe1f30244fe Mon Sep 17 00:00:00 2001 From: Kai Yang Date: Tue, 21 Apr 2015 15:43:03 +0800 Subject: [PATCH] Positioning tooltip before init after changing side --- src/js/angular-tooltips.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/angular-tooltips.js b/src/js/angular-tooltips.js index 9585675..e051738 100644 --- a/src/js/angular-tooltips.js +++ b/src/js/angular-tooltips.js @@ -251,12 +251,14 @@ return offsets[worst] < offsets[key] ? worst : key; }); - if (offsets[worstOffset] < 5) { + if (side != bestPosition && offsets[worstOffset] < 20) { side = bestPosition; + $scope.tooltipPositioning(side); $scope.initTooltip(bestPosition); } + }; //make sure that the tooltip is hidden when the directive is destroyed