diff options
Diffstat (limited to 'ui/widgets')
-rw-r--r-- | ui/widgets/tooltip.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/ui/widgets/tooltip.js b/ui/widgets/tooltip.js index 94021092a..a8f45bc87 100644 --- a/ui/widgets/tooltip.js +++ b/ui/widgets/tooltip.js @@ -114,6 +114,8 @@ $.widget( "ui.tooltip", { } ) .appendTo( this.document[ 0 ].body ); this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" ); + + this.disabledTitles = $( [] ); }, _setOption: function( key, value ) { @@ -143,25 +145,29 @@ $.widget( "ui.tooltip", { } ); // Remove title attributes to prevent native tooltips - this.element.find( this.options.items ).addBack().each( function() { - var element = $( this ); - if ( element.is( "[title]" ) ) { - element - .data( "ui-tooltip-title", element.attr( "title" ) ) - .removeAttr( "title" ); - } - } ); + this.disabledTitles = this.disabledTitles.add( + this.element.find( this.options.items ).addBack() + .filter( function() { + var element = $( this ); + if ( element.is( "[title]" ) ) { + return element + .data( "ui-tooltip-title", element.attr( "title" ) ) + .removeAttr( "title" ); + } + } ) + ); }, _enable: function() { // restore title attributes - this.element.find( this.options.items ).addBack().each( function() { + this.disabledTitles.each( function() { var element = $( this ); if ( element.data( "ui-tooltip-title" ) ) { element.attr( "title", element.data( "ui-tooltip-title" ) ); } } ); + this.disabledTitles = $( [] ); }, open: function( event ) { |