jquery/api.jqueryui.com

$(document).tooltip("enable") does not work correctly

kochelmonster opened this issue · 3 comments

The second line of the following code will disable all tooltips but not reenable them.

$(document).tooltip()
$(document).tooltip("disable").tooltip("enable") 

this is beause disabling the tooltip will remove all "title" attributes but the enable method tries
to find the element with the removed title attributes.

replacing the tooltips _enable method with something like the following will do the job

     _enable: function() {
        // restore title attributes
        old = this.element.find(":data(ui-tooltip-title)"); // additional elements
        this.element.find( this.options.items ).add(old).addBack().each(function() {
            var element = $( this );
            if ( element.data( "ui-tooltip-title" ) ) {
                element.attr( "title", element.data( "ui-tooltip-title" ) );
            }
        });
    }

Thanks for the bug report, but this is the issue tracker for the documentation (hence the repo name of api.jqueryui.com). Please file a bug report at http://bugs.jqueryui.com/newticket.

Also, this proposed change is incorrect. The tooltip instance should never look for other tooltip instances. You'll need to provide a reduced test case showing the bug when you file the issue.

I filed a ticket for you: https://bugs.jqueryui.com/ticket/14950

You can follow progress there.