$( "<button>" )
.text( "Show help" )
.button()
- .click(function() {
+ .on( "click", function() {
tooltips.tooltip( "open" );
})
.insertAfter( "form" );
},
text: !!$( this ).attr( "title" )
});
- button.not( ".menu" ).click(function() {
+ button.not( ".menu" ).on( "click", function() {
notify( button );
});
});
});
$( "button.menu" )
- .click(function() {
+ .on( "click", function() {
$( document ).tooltip( "close", { currentTarget: this });
var menu = $( this ).next().show().position({
my: "left top",
}
});
- element.bind( "tooltipopen", function( event ) {
+ element.on( "tooltipopen", function( event ) {
deepEqual( event.originalEvent.type, "focusin" );
- element.bind( "tooltipclose", function( event ) {
+ element.on( "tooltipclose", function( event ) {
deepEqual( event.originalEvent.type, "focusout" );
start();
});
setTimeout(function() {
- element.blur();
+ element.trigger( "blur" );
});
});
- element.focus();
+ element.trigger( "focus" );
});
asyncTest( "destroy during hide animation; only one close event", function() {
hide: true
});
- element.bind( "tooltipclose", function() {
+ element.on( "tooltipclose", function() {
ok( true, "tooltip closed" );
});
expect( 2 );
var element = $( "#tooltipped1" ).tooltip();
- element.bind( "tooltipopen", function( event ) {
+ element.on( "tooltipopen", function( event ) {
deepEqual( event.originalEvent.type, "mouseover" );
});
element.trigger( "mouseover" );
- element.bind( "tooltipclose", function( event ) {
+ element.on( "tooltipclose", function( event ) {
deepEqual( event.originalEvent.type, "mouseleave" );
});
element.trigger( "focusout" );
expect( 2 );
var element = $( "#tooltipped1" ).tooltip();
- element.bind( "tooltipopen", function( event ) {
+ element.on( "tooltipopen", function( event ) {
deepEqual( event.originalEvent.type, "focusin" );
});
element.trigger( "focusin" );
- element.bind( "tooltipclose", function( event ) {
+ element.on( "tooltipclose", function( event ) {
deepEqual( event.originalEvent.type, "focusout" );
});
element.trigger( "mouseleave" );
expect( 1 );
$( "#qunit-fixture div input" ).tooltip({
track: true
- }).focus();
+ }).trigger( "focus" );
equal( "inputtitle", $( ".ui-tooltip" ).text() );
});
show: {
delay: 500
}
- }).click(function() {
- $( "#focus-on-me" ).focus();
+ }).on( "click", function() {
+ $( "#focus-on-me" ).trigger( "focus" );
});
});
</script>