@@ -173,7 +173,8 @@ define( [ "jquery", "./jquery.mobile.ns", "./jquery.ui.core" ], function( jQuery
173
173
174
174
// Enhance child elements
175
175
enhanceWithin : function ( ) {
176
- var widgetElements ,
176
+ var index ,
177
+ widgetElements = { } ,
177
178
that = this ;
178
179
179
180
// Add no js class to elements
@@ -198,7 +199,8 @@ define( [ "jquery", "./jquery.mobile.ns", "./jquery.ui.core" ], function( jQuery
198
199
199
200
// Add classes for fieldContain
200
201
if ( $ . fn . fieldcontain ) {
201
- this . find ( ":jqmData(role='fieldcontain')" ) . jqmEnhanceable ( ) . fieldcontain ( ) ;
202
+ this . find ( ":jqmData(role='fieldcontain')" ) . not ( $ . mobile . page . prototype . keepNativeSelector ( ) )
203
+ . jqmEnhanceable ( ) . fieldcontain ( ) ;
202
204
}
203
205
204
206
// Enhance widgets
@@ -208,21 +210,25 @@ define( [ "jquery", "./jquery.mobile.ns", "./jquery.ui.core" ], function( jQuery
208
210
if ( constructor . initSelector ) {
209
211
210
212
// Filter elements that should not be enhanced based on parents
211
- widgetElements = $ . mobile . enhanceable ( that . find ( constructor . initSelector ) ) ;
213
+ var elements = $ . mobile . enhanceable ( that . find ( constructor . initSelector ) ) ;
212
214
213
215
// If any matching elements remain filter ones with keepNativeSelector
214
- if ( widgetElements . length ) {
216
+ if ( elements . length ) {
215
217
216
218
// $.mobile.page.prototype.keepNativeSelector is deprecated this is just for backcompat
217
219
// Switch to $.mobile.keepNative in 1.5 which is just a value not a function
218
- widgetElements = widgetElements . not ( $ . mobile . page . prototype . keepNativeSelector ( ) ) ;
220
+ elements = elements . not ( $ . mobile . page . prototype . keepNativeSelector ( ) ) ;
219
221
}
220
222
221
223
// Enhance whatever is left
222
- widgetElements [ constructor . prototype . widgetName ] ( ) ;
224
+ widgetElements [ constructor . prototype . widgetName ] = elements ;
223
225
}
224
226
} ) ;
225
227
228
+ for ( index in widgetElements ) {
229
+ widgetElements [ index ] [ index ] ( ) ;
230
+ }
231
+
226
232
return this ;
227
233
} ,
228
234
0 commit comments