mirror of
https://github.com/myvesta/vesta
synced 2025-07-12 16:13:34 -07:00
fixed toggle all and checkox js bug
This commit is contained in:
parent
6b4b81f7d6
commit
83716cd533
1 changed files with 10 additions and 9 deletions
|
@ -206,11 +206,11 @@ $(document).ready(function(){
|
|||
else {
|
||||
if ($('.l-unit .ch-toggle:eq(0)').attr('checked')) {
|
||||
$('.l-unit').removeClass('selected');
|
||||
$('.l-unit .ch-toggle').attr('checked', false);
|
||||
$('.l-unit .ch-toggle').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
$('.l-unit').addClass('selected');
|
||||
$('.l-unit .ch-toggle').attr('checked', true);
|
||||
$('.l-unit .ch-toggle').prop('checked', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -554,8 +554,8 @@ $(document).ready(function(){
|
|||
children: '.l-unit',
|
||||
'onFinish': function(evt) {
|
||||
var ref = $(evt.target);
|
||||
$('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
|
||||
$('.l-content').find('.l-unit.selected .ch-toggle').attr('checked', true);
|
||||
$('.l-content').find('.l-unit .ch-toggle').prop('checked', false);
|
||||
$('.l-content').find('.l-unit.selected .ch-toggle').prop('checked', true);
|
||||
|
||||
|
||||
if ($('.l-content').find('.l-unit.selected').length == $('.l-content').find('.l-unit').length) {
|
||||
|
@ -566,12 +566,12 @@ $(document).ready(function(){
|
|||
'toggleAllHook': function() {
|
||||
if ($('.l-unit').length == $('.ch-toggle:checked').length) {
|
||||
$('.l-unit.selected').removeClass('selected');
|
||||
$('.ch-toggle').attr('checked', false);
|
||||
$('#toggle-all').attr('checked', false);
|
||||
$('.ch-toggle').prop('checked', false);
|
||||
$('#toggle-all').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
$('.ch-toggle').attr('checked', true);
|
||||
$('#toggle-all').attr('checked', true);
|
||||
$('.ch-toggle').prop('checked', true);
|
||||
$('#toggle-all').prop('checked', true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -585,7 +585,8 @@ $(document).ready(function(){
|
|||
|
||||
//
|
||||
$('form#objects').bind('submit', function(evt) {
|
||||
$('.l-unit.selected').find('.ch-toggle').attr('checked', true);
|
||||
$('.l-unit').find('.ch-toggle').prop('checked', false);
|
||||
$('.l-unit.selected').find('.ch-toggle').prop('checked', true);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue