Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(tooltip): don't show tooltips if there is no content to show
Browse files Browse the repository at this point in the history
Closes #129
  • Loading branch information
pkozlowski-opensource committed Feb 12, 2013
1 parent 7575b3c commit 030901e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ describe('tooltip', function() {
elm.trigger( 'mouseleave' );
}));

it('should not show tooltips if there is nothing to show - issue #129', inject(function ($compile) {

elmBody = $compile(angular.element(
'<div><span tooltip="">Selector Text</span></div>'
))(scope);
scope.$digest();
elmBody.find('span').trigger('mouseenter');

expect(elmBody.children().length).toBe(1);
}));
});


7 changes: 6 additions & 1 deletion src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ angular.module( 'ui.bootstrap.tooltip', [] )
ttWidth,
ttHeight,
ttPosition;


//don't show empty tooltips
if (!scope.tt_tooltip) {
return;
}

// If there is a pending remove transition, we must cancel it, lest the
// toolip be mysteriously removed.
if ( transitionTimeout ) {
Expand Down

0 comments on commit 030901e

Please sign in to comment.