This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tooltip): added tooltip-html-unsafe directive
The directive displays the unsanitized HTML in the tooltip instead of the escaped text. The $tooltip service has been modified to allow a little more flexibility in terms of the prefix used on the $observe'd attributes. For example, the `tooltip-html-unsafe` directive needs to be called as written, but it would be nonsensical to require all other attributes (like animation or placement) to also use that verbose prefix as opposed to the simpler and more familiar `tooltip-` prefix. The service now allows independent specification of the name and its prefix. Lastly, the docs for the tooltip and popover have been updated to show their available optional attributes. Closes #246
- Loading branch information
Josh David Miller
committed
Apr 3, 2013
1 parent
78da771
commit 45ed280
Showing
8 changed files
with
111 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
var TooltipDemoCtrl = function ($scope) { | ||
$scope.dynamicTooltip = "Hello, World!"; | ||
$scope.dynamicTooltipText = "dynamic"; | ||
$scope.htmlTooltip = "I've been made <b>bold</b>!"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
A lightweight, extensible directive for fancy tooltip creation. The tooltip | ||
directive supports multiple placements, optional transition animation, and more. | ||
|
||
There are two versions of the tooltip: `tooltip` and `tooltip-html-unsafe`. The | ||
former takes text only and will escape any HTML provided. The latter takes | ||
whatever HTML is provided and displays it in a tooltip; it called "unsafe" | ||
because the HTML is not sanitized. *The user is responsible for ensuring the | ||
content is safe to put into the DOM!* | ||
|
||
The tooltip directives provide several optional attributes to control how they | ||
will display: | ||
|
||
- `tooltip-placement`: Where to place it? Defaults to "top", but also accepts | ||
"bottom", "left", or "right". | ||
- `tooltip-animation`: Should it fade in and out? Defaults to "true". | ||
- `tooltip-popup-delay`: For how long should the user have to have the mouse | ||
over the element before the tooltip shows (in milliseconds)? Defaults to 0. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }"> | ||
<div class="tooltip-arrow"></div> | ||
<div class="tooltip-inner" ng-bind-html-unsafe="content"></div> | ||
This comment has been minimized.
Sorry, something went wrong. |
||
</div> |
IMO both templates should merged into one, and use boolean attrs.tooptipHtml like twitter's tooltip.