Skip to content

Commit

Permalink
Tooltip: Demo and tests update
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaefferer committed Oct 26, 2010
1 parent 4d6770f commit bdd815e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
9 changes: 9 additions & 0 deletions tests/unit/tooltip/tooltip_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ test("content: return string", function() {
same( $(".ui-tooltip").text(), "customstring" );
});

test("content: return jQuery", function() {
$("#tooltipped1").tooltip({
content: function() {
return $("<div></div>").html("cu<b>s</b>tomstring");
}
}).tooltip("open");
same( $(".ui-tooltip").text(), "customstring" );
});

test("content: callback string", function() {
stop();
$("#tooltipped1").tooltip({
Expand Down
15 changes: 6 additions & 9 deletions tests/visual/tooltip/tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@
$("#context1 a, form input, #childish").tooltip();

// custom class, replaces ui-widget-content
$("#context2 [title]").tooltip({
tooltipClass: "ui-widget-header"
});
$("#right1").tooltip({
tooltipClass: "ui-state-error"
});
$("#context2 [title]").tooltip().each(function() {
$(this).tooltip("widget").addClass("ui-widget-header");
})
$("#right1").tooltip().tooltip("widget").addClass("ui-state-error");

// synchronous content
$("#see-footnote").tooltip({
Expand Down Expand Up @@ -69,9 +67,8 @@
my: "center top",
at: "center bottom",
offset: "0 10"
},
tooltipClass: "ui-state-highlight"
});
}
}).tooltip("widget").addClass("ui-state-highlight");

var positionOnTop = {
position: {
Expand Down

0 comments on commit bdd815e

Please sign in to comment.