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

Commit 7f26410

Browse files
author
kmoroder
committed
un-nest if statements
1 parent 28d2a7f commit 7f26410

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ tooltip-template="" | String() | '' | Set your tooltip template (HTML or just Te
8787
| | | **to know**: don't use it together with `tooltip-template-url` attribute, use only one of them
8888
tooltip-template-url="" | String() | '' | Set your external tooltip template PATH
8989
| | | **to know**: don't use it together with `tooltip-template` attribute, use only one of them
90-
tooltip-controller="" | String() | '' | Set a controller to your external tooltip template
9190
tooltip-template-url-cache="" | String(Boolean) | true | This attribute stores and retrieves the template from the cache
91+
tooltip-controller="" | String() | '' | Set a controller to your external tooltip template
9292
tooltip-smart="" | String(Boolean) | false | Set the tooltip to automatically search the best position on the screen
9393
tooltip-show-trigger="" | String('event1 event2') | 'mouseover' | Show the tooltip on specific event/events
9494
tooltip-hide-trigger="" | String('event1 event2') | 'mouseleave' | Hide the tooltip on specific event/events

dist/angular-tooltips.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -604,22 +604,21 @@
604604
}
605605
}
606606
, onTooltipTemplateUrlCacheChange = function onTooltipTemplateUrlCacheChange(newValue) {
607-
if (newValue) {
607+
if (newValue && $attrs.tooltipTemplateUrl) {
608608

609-
if ($attrs.tooltipTemplateUrl) {
610-
var template = $templateCache.get($attrs.tooltipTemplateUrl);
609+
var template = $templateCache.get($attrs.tooltipTemplateUrl);
611610

612-
if (typeof template !== 'undefined') {
613-
tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty
614-
tipTipElement.empty();
615-
tipTipElement.append(closeButtonElement);
616-
tipTipElement.append($compile(response.data)(scope));
617-
$timeout(function doLater() {
611+
if (typeof template !== 'undefined') {
612+
613+
tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty
614+
tipTipElement.empty();
615+
tipTipElement.append(closeButtonElement);
616+
tipTipElement.append($compile(response.data)(scope));
617+
$timeout(function doLater() {
618618

619-
onTooltipShow();
620-
});
621-
}
622-
};
619+
onTooltipShow();
620+
});
621+
}
623622
} else {
624623
//hide tooltip because is empty
625624
tipTipElement.empty();

0 commit comments

Comments
 (0)