|
Lines 196-202
Link Here
|
| 196 |
$(".flag").on("change",function(e){ |
196 |
$(".flag").on("change",function(e){ |
| 197 |
e.preventDefault(); |
197 |
e.preventDefault(); |
| 198 |
if( $(this).hasClass("child") ){ |
198 |
if( $(this).hasClass("child") ){ |
| 199 |
$(this).closest(".parent").find(".flag.parent").prop("checked", false); |
199 |
if( $(this).prop("checked") ){ |
|
|
200 |
// If this is the last of all the child boxes to be checked the parent should be checked too |
| 201 |
var unchecked = 0; |
| 202 |
$(this).closest(".children").find(".child").each(function(){ |
| 203 |
if( !$(this).prop("checked") ){ |
| 204 |
// There are still unchecked checkboxes in this group |
| 205 |
unchecked = 1; |
| 206 |
} |
| 207 |
}); |
| 208 |
if( unchecked === 0 ){ |
| 209 |
$(this).closest(".parent").find(".flag.parent").prop("checked", true); |
| 210 |
} |
| 211 |
} else { |
| 212 |
$(this).closest(".parent").find(".flag.parent").prop("checked", false); |
| 213 |
} |
| 200 |
} else { |
214 |
} else { |
| 201 |
var bit = $(this).data("bit"); |
215 |
var bit = $(this).data("bit"); |
| 202 |
if( $(this).is(":checked") ){ |
216 |
if( $(this).is(":checked") ){ |
| 203 |
- |
|
|