Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit 9384997

Browse files
committed
Revert dist/ folder.
1 parent 10af6a8 commit 9384997

File tree

3 files changed

+49
-63
lines changed

3 files changed

+49
-63
lines changed

dist/angular-tooltips.js

Lines changed: 46 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* http://720kb.github.io/angular-tooltips
77
*
88
* MIT license
9-
* Fri May 19 2017
9+
* Thu May 18 2017
1010
*/
1111
/*global angular,window*/
1212
(function withAngular(angular, window) {
@@ -225,7 +225,7 @@
225225
'closeButton': false,
226226
'size': '',
227227
'speed': 'steady',
228-
'tooltipTemplateUrlCache': true,
228+
'tooltipTemplateUrlCache': false,
229229
'show': null
230230
};
231231

@@ -571,79 +571,65 @@
571571
registerOnScrollFrom(parentElement);
572572
}
573573
}
574-
, showTemplate = function showTemplate(template) {
575-
576-
tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty
577-
tipTipElement.empty();
578-
tipTipElement.append(closeButtonElement);
579-
tipTipElement.append(template);
580-
$timeout(function doLater() {
581-
582-
onTooltipShow();
583-
});
584-
}
585-
, hideTemplate = function hideTemplate() {
586-
587-
//hide tooltip because is empty
588-
tipTipElement.empty();
589-
tooltipElement.addClass('_force-hidden'); //force to be hidden if empty
590-
}
591-
, getTemplate = function getTemplate(tooltipTemplateUrl) {
592-
593-
var template = $templateCache.get(tooltipTemplateUrl);
594-
595-
if (typeof template === 'undefined') {
596-
597-
// How should failing to load the template be handled?
598-
template = $http.get(tooltipTemplateUrl).then(function onGetTemplateSuccess(response) {
599-
600-
return response.data;
601-
});
602-
$templateCache.put(tooltipTemplateUrl, template);
603-
}
604-
605-
return template;
606-
}
607574
, onTooltipTemplateChange = function onTooltipTemplateChange(newValue) {
608-
609575
if (newValue) {
610-
611-
showTemplate(newValue);
576+
tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty
577+
tipTipElement.empty();
578+
tipTipElement.append(closeButtonElement);
579+
tipTipElement.append(newValue);
580+
$timeout(function doLaterShow() {
581+
582+
onTooltipShow();
583+
});
612584
} else {
613-
614-
hideTemplate();
585+
//hide tooltip because is empty
586+
tipTipElement.empty();
587+
tooltipElement.addClass('_force-hidden'); //force to be hidden if empty
615588
}
616589
}
617590
, onTooltipTemplateUrlChange = function onTooltipTemplateUrlChange(newValue) {
618-
619591
if (newValue && !$attrs.tooltipTemplateUrlCache) {
620-
621-
getTemplate(newValue).then(function onGetTemplateSuccess(template) {
622-
623-
showTemplate($compile(template)(scope));
624-
}).catch(function onGetTemplateFailure(reason) {
625-
626-
$log.error(reason);
592+
593+
$http.get(newValue).then(function onResponse(response) {
594+
595+
if (response &&
596+
response.data) {
597+
598+
tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty
599+
tipTipElement.empty();
600+
tipTipElement.append(closeButtonElement);
601+
tipTipElement.append($compile(response.data)(scope));
602+
$timeout(function doLater() {
603+
604+
onTooltipShow();
605+
});
606+
}
627607
});
628608
} else {
629-
630-
hideTemplate();
609+
//hide tooltip because is empty
610+
tipTipElement.empty();
611+
tooltipElement.addClass('_force-hidden'); //force to be hidden if empty
631612
}
632613
}
633614
, onTooltipTemplateUrlCacheChange = function onTooltipTemplateUrlCacheChange(newValue) {
634-
635615
if (newValue && $attrs.tooltipTemplateUrl) {
636-
637-
getTemplate($attrs.tooltipTemplateUrl).then(function onGetTemplateSuccess(template) {
638-
639-
showTemplate($compile(template)(scope));
640-
}).catch(function onGetTemplateFailure(reason) {
641616

642-
$log.error(reason);
643-
});
617+
var template = $templateCache.get($attrs.tooltipTemplateUrl);
618+
619+
if (typeof template !== 'undefined') {
620+
621+
tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty
622+
tipTipElement.empty();
623+
tipTipElement.append(closeButtonElement);
624+
tipTipElement.append($compile(template)(scope));
625+
$timeout(function doLater() {
626+
onTooltipShow();
627+
});
628+
}
644629
} else {
645-
646-
hideTemplate();
630+
//hide tooltip because is empty
631+
tipTipElement.empty();
632+
tooltipElement.addClass('_force-hidden'); //force to be hidden if empty
647633
}
648634
}
649635
, onTooltipSideChange = function onTooltipSideChange(newValue) {

0 commit comments

Comments
 (0)