@@ -114,6 +114,8 @@ $.widget( "ui.tooltip", {
114
114
} )
115
115
. appendTo ( this . document [ 0 ] . body ) ;
116
116
this . _addClass ( this . liveRegion , null , "ui-helper-hidden-accessible" ) ;
117
+
118
+ this . disabledTitles = $ ( [ ] ) ;
117
119
} ,
118
120
119
121
_setOption : function ( key , value ) {
@@ -143,25 +145,29 @@ $.widget( "ui.tooltip", {
143
145
} ) ;
144
146
145
147
// Remove title attributes to prevent native tooltips
146
- this . element . find ( this . options . items ) . addBack ( ) . each ( function ( ) {
147
- var element = $ ( this ) ;
148
- if ( element . is ( "[title]" ) ) {
149
- element
150
- . data ( "ui-tooltip-title" , element . attr ( "title" ) )
151
- . removeAttr ( "title" ) ;
152
- }
153
- } ) ;
148
+ this . disabledTitles = this . disabledTitles . add (
149
+ this . element . find ( this . options . items ) . addBack ( )
150
+ . filter ( function ( ) {
151
+ var element = $ ( this ) ;
152
+ if ( element . is ( "[title]" ) ) {
153
+ return element
154
+ . data ( "ui-tooltip-title" , element . attr ( "title" ) )
155
+ . removeAttr ( "title" ) ;
156
+ }
157
+ } )
158
+ ) ;
154
159
} ,
155
160
156
161
_enable : function ( ) {
157
162
158
163
// restore title attributes
159
- this . element . find ( this . options . items ) . addBack ( ) . each ( function ( ) {
164
+ this . disabledTitles . each ( function ( ) {
160
165
var element = $ ( this ) ;
161
166
if ( element . data ( "ui-tooltip-title" ) ) {
162
167
element . attr ( "title" , element . data ( "ui-tooltip-title" ) ) ;
163
168
}
164
169
} ) ;
170
+ this . disabledTitles = $ ( [ ] ) ;
165
171
} ,
166
172
167
173
open : function ( event ) {
0 commit comments