Skip to content

Commit e9751f7

Browse files
committed
tooltip template url cache fix
1 parent dab10a6 commit e9751f7

8 files changed

+35
-21
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-tooltips",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "Angular.js tooltips module.",
55
"authors": [
66
"Filippo Oretti <[email protected]",

dist/angular-tooltips.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-tooltips.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
22
* angular-tooltips
3-
* 1.1.4
3+
* 1.1.5
44
*
55
* Angular.js tooltips module.
66
* http://720kb.github.io/angular-tooltips
77
*
88
* MIT license
9-
* Mon Jun 06 2016
9+
* Thu Aug 04 2016
1010
*/
1111
/*global angular,window*/
1212
(function withAngular(angular, window) {
@@ -247,7 +247,7 @@
247247
}
248248
};
249249
}
250-
, tooltipDirective = /*@ngInject*/ ["$log", "$http", "$compile", "$timeout", "$controller", "$injector", "tooltipsConf", "$templateCache", function tooltipDirective($log, $http, $compile, $timeout, $controller, $injector, tooltipsConf) {
250+
, tooltipDirective = /*@ngInject*/ ['$log', '$http', '$compile', '$timeout', '$controller', '$injector', 'tooltipsConf', '$templateCache', function tooltipDirective($log, $http, $compile, $timeout, $controller, $injector, tooltipsConf, $templateCache) {
251251

252252
var linkingFunction = function linkingFunction($scope, $element, $attrs, $controllerDirective, $transcludeFunc) {
253253

@@ -609,14 +609,21 @@
609609
var template = $templateCache.get($attrs.tooltipTemplateUrl);
610610

611611
if (typeof template !== 'undefined') {
612-
612+
613613
tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty
614614
tipTipElement.empty();
615615
tipTipElement.append(closeButtonElement);
616-
tipTipElement.append($compile(response.data)(scope));
617-
$timeout(function doLater() {
616+
$http.get(newValue).then(function onResponse(response) {
617+
618+
if (response &&
619+
response.data) {
618620

619-
onTooltipShow();
621+
tipTipElement.append($compile(response.data)(scope));
622+
$timeout(function doLater() {
623+
624+
onTooltipShow();
625+
});
626+
}
620627
});
621628
}
622629
} else {

dist/angular-tooltips.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-tooltips.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-tooltips.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/angular-tooltips.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
}
238238
};
239239
}
240-
, tooltipDirective = /*@ngInject*/ ["$log", "$http", "$compile", "$timeout", "$controller", "$injector", "tooltipsConf", "$templateCache", function tooltipDirective($log, $http, $compile, $timeout, $controller, $injector, tooltipsConf) {
240+
, tooltipDirective = /*@ngInject*/ ['$log', '$http', '$compile', '$timeout', '$controller', '$injector', 'tooltipsConf', '$templateCache', function tooltipDirective($log, $http, $compile, $timeout, $controller, $injector, tooltipsConf, $templateCache) {
241241

242242
var linkingFunction = function linkingFunction($scope, $element, $attrs, $controllerDirective, $transcludeFunc) {
243243

@@ -603,10 +603,17 @@
603603
tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty
604604
tipTipElement.empty();
605605
tipTipElement.append(closeButtonElement);
606-
tipTipElement.append($compile(response.data)(scope));
607-
$timeout(function doLater() {
606+
$http.get(newValue).then(function onResponse(response) {
608607

609-
onTooltipShow();
608+
if (response &&
609+
response.data) {
610+
611+
tipTipElement.append($compile(response.data)(scope));
612+
$timeout(function doLater() {
613+
614+
onTooltipShow();
615+
});
616+
}
610617
});
611618
}
612619
} else {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-tooltips",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "Angular.js tooltips module.",
55
"homepage": "http://720kb.github.io/angular-tooltips",
66
"main": "index.js",

0 commit comments

Comments
 (0)