diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-08-31 15:38:21 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-08-31 15:38:21 -0400 |
commit | dee7c8bd4493826e13b78b2d702947e6f4ad966e (patch) | |
tree | 19b769f7076c19fd23df650799b241c05aefb8c1 /tests/unit/tooltip | |
parent | c135fc18a392476e5163376aed85525a80575e24 (diff) | |
download | jquery-ui-dee7c8bd4493826e13b78b2d702947e6f4ad966e.tar.gz jquery-ui-dee7c8bd4493826e13b78b2d702947e6f4ad966e.zip |
Tooltip: Update open tooltips if the content option changes. Fixes #8544 - Unable to update tooltip content dynamically.
Diffstat (limited to 'tests/unit/tooltip')
-rw-r--r-- | tests/unit/tooltip/tooltip_options.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js index 771da6da7..561f3ffe5 100644 --- a/tests/unit/tooltip/tooltip_options.js +++ b/tests/unit/tooltip/tooltip_options.js @@ -46,6 +46,25 @@ asyncTest( "content: sync + async callback", function() { }).tooltip( "open" ); }); +test( "content: change while open", function() { + expect( 2 ) ; + var element = $( "#tooltipped1" ).tooltip({ + content: function() { + return "old"; + } + }); + + element.one( "tooltipopen", function( event, ui ) { + equal( ui.tooltip.text(), "old", "original content" ); + element.tooltip( "option", "content", function() { + return "new"; + }); + equal( ui.tooltip.text(), "new", "updated content" ); + }); + + element.tooltip( "open" ); +}); + test( "items", function() { expect( 2 ); var event, |