This commit is contained in:
Nightblade73 2019-03-23 12:52:52 +04:00
parent 50dbe8cb8f
commit edd6aee00f
2 changed files with 7 additions and 5 deletions

View File

@ -8,16 +8,18 @@ $(document).ready(function () {
$(this).children('.circle').toggleClass('circle-active');
});
$('.checkbox').parent().click( function() {
$('.checkbox-js').parent().click( function() {
$(this).children('.checkbox').toggleClass('selected');
});
$('#select-all-js').click( function() {
$(this).toggleClass('selected');
var childNodes = $('.conference-item .form-check .checkbox')
.each(function(i, elem) {
if ($(this).hasClass('selected') && $('#select-all-js').hasClass('selected')) {
if ($(this).hasClass('selected') && !$('#select-all-js').hasClass('selected')) {
$(this).toggleClass('selected');
} else if (!$(this).hasClass('selected') && !$('#select-all-js').hasClass('selected')){
} else if (!$(this).hasClass('selected') && $('#select-all-js').hasClass('selected')){
$(this).toggleClass('selected');
}
});

View File

@ -35,7 +35,7 @@
<div class="conference-list-body list-group">
<div class="conference-item d-flex bd-highlight list-group-item">
<div class="form-check p-1 bd-highlight">
<div class="checkbox"></div>
<div class="checkbox checkbox-js"></div>
</div>
<div class="form-check p-1 bd-highlight">
<div class="circle"></div>
@ -48,7 +48,7 @@
</div>
<div class="conference-item d-flex bd-highlight list-group-item">
<div class="form-check p-1 bd-highlight">
<div class="checkbox"></div>
<div class="checkbox checkbox-js"></div>
</div>
<div class="form-check p-1 bd-highlight">
<div class="circle"></div>