mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tooltip: Preserve the title after disabling twice
Fixes #9719 Closes gh-1154
This commit is contained in:
parent
9413043a9e
commit
0dc84db853
@ -54,7 +54,7 @@ test( "open/close with tracking", function() {
|
||||
});
|
||||
|
||||
test( "enable/disable", function() {
|
||||
expect( 10 );
|
||||
expect( 11 );
|
||||
$.fx.off = true;
|
||||
var tooltip,
|
||||
element = $( "#tooltipped1" ).tooltip();
|
||||
@ -82,6 +82,12 @@ test( "enable/disable", function() {
|
||||
element.tooltip( "enable" );
|
||||
equal( element.attr( "title" ), "anchortitle", "title restored on enable" );
|
||||
|
||||
// #9719 - Title should be preserved after disabling twice
|
||||
element.tooltip( "disable" );
|
||||
element.tooltip( "disable" );
|
||||
element.tooltip( "enable" );
|
||||
equal( element.attr( "title" ), "anchortitle", "title restored on enable after being disabled twice" );
|
||||
|
||||
element.tooltip( "open" );
|
||||
tooltip = $( "#" + element.data( "ui-tooltip-id" ) );
|
||||
ok( tooltip.is( ":visible" ) );
|
||||
|
2
ui/jquery.ui.tooltip.js
vendored
2
ui/jquery.ui.tooltip.js
vendored
@ -129,7 +129,7 @@ $.widget( "ui.tooltip", {
|
||||
if ( element.is( "[title]" ) ) {
|
||||
element
|
||||
.data( "ui-tooltip-title", element.attr( "title" ) )
|
||||
.attr( "title", "" );
|
||||
.removeAttr( "title" );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user