Skip to content

Commit 55449ed

Browse files
committed
should work now, temp closes #156
1 parent 7b720e1 commit 55449ed

11 files changed

+44
-23
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.0.9",
3+
"version": "1.0.10",
44
"description": "Angular.js tooltips module.",
55
"authors": [
66
"Filippo Oretti <[email protected]",

dist/angular-tooltips.css

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

dist/angular-tooltips.css.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.css.min.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.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
22
* angular-tooltips
3-
* 1.0.9
3+
* 1.0.10
44
*
55
* Angular.js tooltips module.
66
* http://720kb.github.io/angular-tooltips
77
*
88
* MIT license
9-
* Wed Apr 13 2016
9+
* Sat Apr 30 2016
1010
*/
1111
/*global angular,window*/
1212
(function withAngular(angular, window) {
@@ -238,7 +238,7 @@
238238
if ($attrs.tooltipTemplate &&
239239
$attrs.tooltipTemplateUrl) {
240240

241-
throw new Error('You can not define tooltip-template and tooltip-url together');
241+
throw new Error('You can not define tooltip-template and tooltip-template-url together');
242242
}
243243

244244
if (!($attrs.tooltipTemplateUrl || $attrs.tooltipTemplate) &&
@@ -288,6 +288,7 @@
288288
}
289289
}
290290
, onTooltipShow = function onTooltipShow(event) {
291+
291292
tipElement.addClass('_hidden');
292293
if ($attrs.tooltipSmart) {
293294

@@ -549,14 +550,18 @@
549550
, onTooltipTemplateChange = function onTooltipTemplateChange(newValue) {
550551

551552
if (newValue) {
552-
553+
tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty
553554
tipTipElement.empty();
554555
tipTipElement.append(closeButtonElement);
555556
tipTipElement.append(newValue);
556-
$timeout(function doLater() {
557+
$timeout(function doLaterShow() {
557558

558559
onTooltipShow();
559560
});
561+
} else {
562+
//hide tooltip because is empty
563+
tipTipElement.empty();
564+
tooltipElement.addClass('_force-hidden'); //force to be hidden if empty
560565
}
561566
}
562567
, onTooltipTemplateUrlChange = function onTooltipTemplateUrlChange(newValue) {
@@ -568,6 +573,7 @@
568573
if (response &&
569574
response.data) {
570575

576+
tooltipElement.removeClass('_force-hidden'); //see lines below, this forces to hide tooltip when is empty
571577
tipTipElement.empty();
572578
tipTipElement.append(closeButtonElement);
573579
tipTipElement.append($compile(response.data)(scope));
@@ -577,6 +583,10 @@
577583
});
578584
}
579585
});
586+
} else {
587+
//hide tooltip because is empty
588+
tipTipElement.empty();
589+
tooltipElement.addClass('_force-hidden'); //force to be hidden if empty
580590
}
581591
}
582592
, onTooltipSideChange = function onTooltipSideChange(newValue) {

0 commit comments

Comments
 (0)