2010-04-15 07:45:35 +00:00
|
|
|
/*
|
|
|
|
* tooltip_options.js
|
|
|
|
*/
|
|
|
|
(function($) {
|
|
|
|
|
2010-10-26 12:26:53 +00:00
|
|
|
module("tooltip: options", {
|
|
|
|
teardown: function() {
|
2010-04-15 07:45:35 +00:00
|
|
|
$(":ui-tooltip").tooltip("destroy");
|
2010-10-26 12:26:53 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2010-10-26 15:07:22 +00:00
|
|
|
|
|
|
|
test("option: items", function() {
|
|
|
|
ok(false, "missing items test");
|
|
|
|
});
|
|
|
|
|
2010-10-26 12:26:53 +00:00
|
|
|
test("content: default", function() {
|
|
|
|
$("#tooltipped1").tooltip().tooltip("open");
|
|
|
|
same( $(".ui-tooltip").text(), "anchortitle" );
|
|
|
|
});
|
2010-04-15 07:45:35 +00:00
|
|
|
|
2010-10-26 12:26:53 +00:00
|
|
|
test("content: return string", function() {
|
|
|
|
$("#tooltipped1").tooltip({
|
|
|
|
content: function() {
|
|
|
|
return "customstring";
|
|
|
|
}
|
|
|
|
}).tooltip("open");
|
|
|
|
same( $(".ui-tooltip").text(), "customstring" );
|
2010-04-15 07:45:35 +00:00
|
|
|
});
|
2010-10-26 12:26:53 +00:00
|
|
|
|
2010-10-26 13:36:43 +00:00
|
|
|
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" );
|
|
|
|
});
|
|
|
|
|
2010-10-26 12:26:53 +00:00
|
|
|
test("content: callback string", function() {
|
|
|
|
stop();
|
|
|
|
$("#tooltipped1").tooltip({
|
|
|
|
content: function(response) {
|
|
|
|
response("customstring2");
|
|
|
|
setTimeout(function() {
|
|
|
|
same( $(".ui-tooltip").text(), "customstring2" );
|
|
|
|
start();
|
|
|
|
}, 100)
|
|
|
|
}
|
|
|
|
}).tooltip("open");
|
|
|
|
|
2010-04-15 07:45:35 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
})(jQuery);
|