Tooltip: Run _disable when disabled option is set on create. Fixes #8712 - Tooltip: Disabled tooltips on initialization.

This commit is contained in:
Jörn Zaefferer 2012-10-24 10:00:39 -04:00
parent 1fcccd45ce
commit ba752cf7ed
2 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,14 @@
module( "tooltip: options" );
test( "disabled: true", function() {
expect( 1 );
$( "#tooltipped1" ).tooltip({
disabled: true
}).tooltip( "open" );
equal( $( ".ui-tooltip" ).length, 0 );
});
test( "content: default", function() {
expect( 1 );
var element = $( "#tooltipped1" ).tooltip().tooltip( "open" );

View File

@ -75,6 +75,10 @@ $.widget( "ui.tooltip", {
this.tooltips = {};
// IDs of parent tooltips where we removed the title attribute
this.parents = {};
if ( this.options.disabled ) {
this._disable();
}
},
_setOption: function( key, value ) {