Permalink
Browse files

Tooltip: Preserve the title after disabling twice

Fixes #9719
Closes gh-1154
  • Loading branch information...
mwiencek authored and jzaefferer committed Dec 24, 2013
1 parent 9413043 commit 0dc84db853751f5f0ccfd9f79cbf8355dcc4b09c
Showing with 8 additions and 2 deletions.
  1. +7 −1 tests/unit/tooltip/tooltip_methods.js
  2. +1 −1 ui/jquery.ui.tooltip.js
@@ -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" ) );
View
@@ -129,7 +129,7 @@ $.widget( "ui.tooltip", {
if ( element.is( "[title]" ) ) {
element
.data( "ui-tooltip-title", element.attr( "title" ) )
.attr( "title", "" );
.removeAttr( "title" );
}
});
},

0 comments on commit 0dc84db

Please sign in to comment.