@@ -223,26 +223,29 @@ define([
223223 * @param {* } containerId
224224 */
225225 enableOptionsContainer : function ( containerId ) {
226- $$ ( '#' + containerId + ' .widget-option' ) . each ( function ( e ) {
226+ var container = $ ( containerId ) ;
227+
228+ container . select ( '.widget-option' ) . each ( function ( e ) {
227229 e . removeClassName ( 'skip-submit' ) ;
228230
229231 if ( e . hasClassName ( 'obligatory' ) ) {
230232 e . removeClassName ( 'obligatory' ) ;
231233 e . addClassName ( 'required-entry' ) ;
232234 }
233235 } ) ;
234- $ ( containerId ) . removeClassName ( 'no-display' ) ;
236+ container . removeClassName ( 'no-display' ) ;
235237 } ,
236238
237239 /**
238240 * @param {* } containerId
239241 */
240242 disableOptionsContainer : function ( containerId ) {
243+ var container = $ ( containerId ) ;
241244
242- if ( $ ( containerId ) . hasClassName ( 'no-display' ) ) {
245+ if ( container . hasClassName ( 'no-display' ) ) {
243246 return ;
244247 }
245- $$ ( '#' + containerId + ' .widget-option') . each ( function ( e ) {
248+ container . select ( ' .widget-option') . each ( function ( e ) {
246249 // Avoid submitting fields of unactive container
247250 if ( ! e . hasClassName ( 'skip-submit' ) ) {
248251 e . addClassName ( 'skip-submit' ) ;
@@ -253,7 +256,7 @@ define([
253256 e . addClassName ( 'obligatory' ) ;
254257 }
255258 } ) ;
256- $ ( containerId ) . addClassName ( 'no-display' ) ;
259+ container . addClassName ( 'no-display' ) ;
257260 } ,
258261
259262 /**
@@ -439,7 +442,7 @@ define([
439442 i = 0 ;
440443 Form . getElements ( $ ( this . formEl ) ) . each ( function ( e ) {
441444
442- if ( ! e . hasClassName ( ' skip-submit' ) ) {
445+ if ( jQuery ( e ) . closest ( '. skip-submit, .no-display' ) . length === 0 ) {
443446 formElements [ i ] = e ;
444447 i ++ ;
445448 }
0 commit comments