File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 166166 `[data-type="name"][data-${ feat } =0])`
167167 ) ;
168168 if ( btn . data ( "visible" ) ) {
169+ children . each ( function ( ) { $ ( this ) . data ( "visible" , false ) ; } ;
169170 children . hide ( 400 ) ;
170- children . data ( "visible" , false ) ;
171171 btn . data ( "visible" , false ) ;
172172 btn . find ( "span" ) . html ( "Show" ) ;
173173 btn . find ( "i" ) . removeClass ( "fa-eye-slash" ) ;
174174 btn . find ( "i" ) . addClass ( "fa-eye" ) ;
175175 } else {
176+ children . each ( function ( ) { $ ( this ) . data ( "visible" , true ) ; } ;
176177 children . show ( 400 ) ;
177- children . data ( "visible" , true ) ;
178178 btn . data ( "visible" , true ) ;
179179 btn . find ( "span" ) . html ( "Hide" ) ;
180180 btn . find ( "i" ) . removeClass ( "fa-eye" ) ;
181181 btn . find ( "i" ) . addClass ( "fa-eye-slash" ) ;
182182 }
183183 var all = $ ( `ul#name-${ name_id } -children li` ) . length ;
184- var visible = $ ( `ul#name-${ name_id } -children li:visible` ) . length ;
184+ var visible = $ (
185+ // I cannot use the :visible selector because of the 400ms delay
186+ // in the animation
187+ `ul#name-${ name_id } -children li[data-visible=true]`
188+ ) . length ;
185189 var cnt = $ ( `#name-${ name_id } -children-count` ) ;
186190 cnt . html ( all == visible ? `(${ all } )` : `(${ visible } /${ all } )` ) ;
187191 return false ;
You can’t perform that action at this time.
0 commit comments