]> source.dussan.org Git - jquery-ui.git/commitdiff
Tooltip: Run _disable when disabled option is set on create. Fixes #8712 - Tooltip...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 24 Oct 2012 14:00:39 +0000 (10:00 -0400)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 24 Oct 2012 14:02:21 +0000 (10:02 -0400)
tests/unit/tooltip/tooltip_options.js
ui/jquery.ui.tooltip.js

index 3be6518558f2ddbafe7af90f44d58b63bb9a480f..9f0de2b570701e6897b6982a44ccd728d9bc34ab 100644 (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" );
index 43788a082e8931dea426a6a27c8be36e99ac67a5..f93dd7a2f84a5afb3fb39113bf91536c7fcac501 100644 (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 ) {