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

Commit

Permalink
fix(tooltip): tooltip-html should not open if empty
Browse files Browse the repository at this point in the history
Closes #3563
  • Loading branch information
chrisirhc authored and rvanbaalen committed Apr 29, 2015
1 parent 422c823 commit 34044a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/tooltip/test/tooltip.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,13 @@ describe( 'tooltipHtml', function() {
expect( elmBody.find('.tooltip-inner').html() ).toBe( scope.html );
}));

it( 'should not open if html is empty', function () {
scope.safeHtml = null;
scope.$digest();
elm.trigger( 'mouseenter' );
expect( tooltipScope.isOpen ).toBe( false );
});

it( 'should show on mouseenter and hide on mouseleave', inject( function ($sce) {
expect( tooltipScope.isOpen ).toBe( false );

Expand Down
4 changes: 3 additions & 1 deletion src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ function ($animate , $sce , $compile , $templateRequest) {
})

.directive( 'tooltipHtml', [ '$tooltip', function ( $tooltip ) {
return $tooltip( 'tooltipHtml', 'tooltip', 'mouseenter' );
return $tooltip('tooltipHtml', 'tooltip', 'mouseenter', {
useContentExp: true
});
}])

/*
Expand Down

0 comments on commit 34044a7

Please sign in to comment.