File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -245,9 +245,7 @@ Tree.prototype.redrawSectionCheckboxes = function ($section) {
245245 if ( returnVal ) {
246246 let $childCheckboxes = $section . find ( '> div.item > input[type=checkbox]' ) ;
247247 for ( let ii = 0 ; ii < $childCheckboxes . length ; ++ ii ) {
248- if ( $childCheckboxes [ ii ] . disabled ) {
249- // do nothing
250- } else if ( $childCheckboxes [ ii ] . checked ) {
248+ if ( $childCheckboxes [ ii ] . checked ) {
251249 returnVal &= ~ 0b10 ;
252250 } else {
253251 returnVal &= ~ 0b01 ;
Original file line number Diff line number Diff line change @@ -146,6 +146,21 @@ describe('Options', () => {
146146 assert . equal ( removeSpans . length , 0 ) ;
147147 } ) ;
148148
149+ it ( 'section checkboxes are indetermine if some children are selected' , ( ) => {
150+ $ ( "select" ) . append ( "<option value='one' data-section='test'>One</option>" ) ;
151+ $ ( "select" ) . append ( "<option value='two' data-section='test' selected='selected'>Two</option>" ) ;
152+ var options = {
153+ freeze : true
154+ } ;
155+ $ ( "select" ) . treeMultiselect ( options ) ;
156+
157+ var $sectionCheckbox = Common . sectionCheckbox ( { text : 'test' } ) ;
158+ assert . equal ( $sectionCheckbox . length , 1 ) ;
159+ var checkbox = $sectionCheckbox [ 0 ] ;
160+ assert ( checkbox . indeterminate ) ;
161+ assert ( ! checkbox . checked ) ;
162+ } ) ;
163+
149164 it ( 'applies only to one tree and not another' , ( ) => {
150165 $ ( "select" ) . append ( "<option value='one' data-section='test'>One</option>" ) ;
151166 $ ( "select" ) . treeMultiselect ( ) ;
You can’t perform that action at this time.
0 commit comments