aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wiencek <mwtuea@gmail.com>2013-12-23 20:40:30 -0600
committerJörn Zaefferer <joern.zaefferer@gmail.com>2014-01-09 20:38:08 +0100
commit0dc84db853751f5f0ccfd9f79cbf8355dcc4b09c (patch)
tree4825714222c3c030c43c2953208db5eb310ca351
parent9413043a9e6230bce9a0b439a6e78c86fa0d38af (diff)
downloadjquery-ui-0dc84db853751f5f0ccfd9f79cbf8355dcc4b09c.tar.gz
jquery-ui-0dc84db853751f5f0ccfd9f79cbf8355dcc4b09c.zip
Tooltip: Preserve the title after disabling twice
Fixes #9719 Closes gh-1154
-rw-r--r--tests/unit/tooltip/tooltip_methods.js8
-rw-r--r--ui/jquery.ui.tooltip.js2
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js
index ead360bf3..8d1b1bd5b 100644
--- a/tests/unit/tooltip/tooltip_methods.js
+++ b/tests/unit/tooltip/tooltip_methods.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" ) );
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index a8c3c14bd..274bcebdf 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -129,7 +129,7 @@ $.widget( "ui.tooltip", {
if ( element.is( "[title]" ) ) {
element
.data( "ui-tooltip-title", element.attr( "title" ) )
- .attr( "title", "" );
+ .removeAttr( "title" );
}
});
},