File tree Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Original file line number Diff line number Diff line change 345345 var $checkboxesNotThis = $ ( 'input' , this . $container ) . not ( $target ) ;
346346
347347 if ( isSelectAllOption ) {
348- if ( this . $select [ 0 ] [ 0 ] . value === this . options . selectAllValue ) {
349-
350- var values = [ ] ;
351- var options = $ ( 'option[value!="' + this . options . selectAllValue + '"][data-role!="divider"]' , this . $select ) ;
352-
353- for ( var i = 0 ; i < options . length ; i ++ ) {
354-
355- // Check whether this option is actually visible.
356- if ( this . getInputByValue ( options [ i ] . value ) && this . getInputByValue ( options [ i ] . value ) . is ( ':visible' ) ) {
357- values . push ( options [ i ] . value ) ;
358- }
359- }
348+ var values = [ ] ;
349+ // Select the visible checkboxes except the "select-all" and possible divider.
350+ var availableInputs = $ ( 'li input[value!="' + this . options . selectAllValue + '"][data-role!="divider"]' , this . $ul ) . filter ( ':visible' ) ;
351+
352+ for ( var i = 0 , j = availableInputs . length ; i < j ; i ++ ) {
353+ values . push ( availableInputs [ i ] . value ) ;
354+ }
360355
361- if ( checked ) {
362- this . select ( values ) ;
363- }
364- else {
365- this . deselect ( values ) ;
366- }
356+ if ( checked ) {
357+ this . select ( values ) ;
358+ }
359+ else {
360+ this . deselect ( values ) ;
367361 }
368362 }
369363
You can’t perform that action at this time.
0 commit comments