diff options
author | Andrew Couch <acouch@bluewolf.com> | 2012-10-16 12:55:50 -0400 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-10-21 13:15:59 -0400 |
commit | 0b3e59f149054122d8948c29baa4bb174006d75e (patch) | |
tree | f7a653579b42f455e03fd4a83d7f6682e3593034 /tests/unit | |
parent | 3b2d1e7736be99671af70aa3b775d67b917517e5 (diff) | |
download | jquery-ui-0b3e59f149054122d8948c29baa4bb174006d75e.tar.gz jquery-ui-0b3e59f149054122d8948c29baa4bb174006d75e.zip |
Tooltip: Do not attempt to position if tooltip is hidden. Fixed #8644 - Delayed tooltips set to track should reposition when being shown for the first time.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/tooltip/tooltip_options.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js index db193e8fa..e5046f464 100644 --- a/tests/unit/tooltip/tooltip_options.js +++ b/tests/unit/tooltip/tooltip_options.js @@ -103,4 +103,39 @@ test( "tooltipClass", function() { ok( $( "#" + element.data( "ui-tooltip-id" ) ).hasClass( "custom" ) ); }); +test( "track + show delay", function() { + expect( 2 ); + var event, + leftVal = 314, + topVal = 159, + offsetVal = 26, + element = $( "#tooltipped1" ).tooltip({ + track: true, + show: { + delay: 1 + }, + position: { + my: "left+" + offsetVal + " top+" + offsetVal, + at: "right bottom" + } + }); + + event = $.Event( "mouseover" ); + event.target = $( "#tooltipped1" )[ 0 ]; + event.originalEvent = { type: "mouseover" }; + event.pageX = leftVal; + event.pageY = topVal; + element.trigger( event ); + + event = $.Event( "mousemove" ); + event.target = $( "#tooltipped1" )[ 0 ]; + event.originalEvent = { type: "mousemove" }; + event.pageX = leftVal; + event.pageY = topVal; + element.trigger( event ); + + equal( $( ".ui-tooltip" ).css( "left" ), leftVal + offsetVal + "px" ); + equal( $( ".ui-tooltip" ).css( "top" ), topVal + offsetVal + "px" ); +}); + }( jQuery ) ); |