@@ -223,26 +223,29 @@ define([
223
223
* @param {* } containerId
224
224
*/
225
225
enableOptionsContainer : function ( containerId ) {
226
- $$ ( '#' + containerId + ' .widget-option' ) . each ( function ( e ) {
226
+ var container = $ ( containerId ) ;
227
+
228
+ container . select ( '.widget-option' ) . each ( function ( e ) {
227
229
e . removeClassName ( 'skip-submit' ) ;
228
230
229
231
if ( e . hasClassName ( 'obligatory' ) ) {
230
232
e . removeClassName ( 'obligatory' ) ;
231
233
e . addClassName ( 'required-entry' ) ;
232
234
}
233
235
} ) ;
234
- $ ( containerId ) . removeClassName ( 'no-display' ) ;
236
+ container . removeClassName ( 'no-display' ) ;
235
237
} ,
236
238
237
239
/**
238
240
* @param {* } containerId
239
241
*/
240
242
disableOptionsContainer : function ( containerId ) {
243
+ var container = $ ( containerId ) ;
241
244
242
- if ( $ ( containerId ) . hasClassName ( 'no-display' ) ) {
245
+ if ( container . hasClassName ( 'no-display' ) ) {
243
246
return ;
244
247
}
245
- $$ ( '#' + containerId + ' .widget-option') . each ( function ( e ) {
248
+ container . select ( ' .widget-option') . each ( function ( e ) {
246
249
// Avoid submitting fields of unactive container
247
250
if ( ! e . hasClassName ( 'skip-submit' ) ) {
248
251
e . addClassName ( 'skip-submit' ) ;
@@ -253,7 +256,7 @@ define([
253
256
e . addClassName ( 'obligatory' ) ;
254
257
}
255
258
} ) ;
256
- $ ( containerId ) . addClassName ( 'no-display' ) ;
259
+ container . addClassName ( 'no-display' ) ;
257
260
} ,
258
261
259
262
/**
@@ -439,7 +442,7 @@ define([
439
442
i = 0 ;
440
443
Form . getElements ( $ ( this . formEl ) ) . each ( function ( e ) {
441
444
442
- if ( ! e . hasClassName ( ' skip-submit' ) ) {
445
+ if ( jQuery ( e ) . closest ( '. skip-submit, .no-display' ) . length === 0 ) {
443
446
formElements [ i ] = e ;
444
447
i ++ ;
445
448
}
0 commit comments