Skip to content

Commit bdd815e

Browse files
committed
Tooltip: Demo and tests update
1 parent 4d6770f commit bdd815e

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

tests/unit/tooltip/tooltip_options.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ test("content: return string", function() {
2323
same( $(".ui-tooltip").text(), "customstring" );
2424
});
2525

26+
test("content: return jQuery", function() {
27+
$("#tooltipped1").tooltip({
28+
content: function() {
29+
return $("<div></div>").html("cu<b>s</b>tomstring");
30+
}
31+
}).tooltip("open");
32+
same( $(".ui-tooltip").text(), "customstring" );
33+
});
34+
2635
test("content: callback string", function() {
2736
stop();
2837
$("#tooltipped1").tooltip({

tests/visual/tooltip/tooltip.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424
$("#context1 a, form input, #childish").tooltip();
2525

2626
// custom class, replaces ui-widget-content
27-
$("#context2 [title]").tooltip({
28-
tooltipClass: "ui-widget-header"
29-
});
30-
$("#right1").tooltip({
31-
tooltipClass: "ui-state-error"
32-
});
27+
$("#context2 [title]").tooltip().each(function() {
28+
$(this).tooltip("widget").addClass("ui-widget-header");
29+
})
30+
$("#right1").tooltip().tooltip("widget").addClass("ui-state-error");
3331

3432
// synchronous content
3533
$("#see-footnote").tooltip({
@@ -69,9 +67,8 @@
6967
my: "center top",
7068
at: "center bottom",
7169
offset: "0 10"
72-
},
73-
tooltipClass: "ui-state-highlight"
74-
});
70+
}
71+
}).tooltip("widget").addClass("ui-state-highlight");
7572

7673
var positionOnTop = {
7774
position: {

0 commit comments

Comments
 (0)