Skip to content

Commit

Permalink
Tooltip: Run _disable when disabled option is set on create. Fixes #8…
Browse files Browse the repository at this point in the history
…712 - Tooltip: Disabled tooltips on initialization.
  • Loading branch information
jzaefferer committed Oct 24, 2012
1 parent 1fcccd4 commit ba752cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/unit/tooltip/tooltip_options.js
Expand Up @@ -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" );
Expand Down
4 changes: 4 additions & 0 deletions ui/jquery.ui.tooltip.js
Expand Up @@ -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 ) {
Expand Down

0 comments on commit ba752cf

Please sign in to comment.