mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
Merge pull request #3340 from aignatov-bio/ai-sci-5714-fix-checkbox-in-report-wizard
Add indeterminate state to report wizard checkbox [SCI-5714]
This commit is contained in:
commit
371a51c4de
1 changed files with 39 additions and 4 deletions
|
@ -1331,10 +1331,7 @@ function reportHandsonTableConverter() {
|
|||
disableSearch: true
|
||||
});
|
||||
|
||||
function SelectAllRepositoriesStatus() {
|
||||
var selectAll = $('.task-contents-container .select-all-repositories');
|
||||
var all = $('.repositories-contents .sci-checkbox').length;
|
||||
var checked = $('.repositories-contents .sci-checkbox:checked').length;
|
||||
function selectAllCheckboxState(selectAll, all, checked) {
|
||||
selectAll.prop('indeterminate', false);
|
||||
if (all === checked) {
|
||||
selectAll.prop('checked', true);
|
||||
|
@ -1344,6 +1341,35 @@ function reportHandsonTableConverter() {
|
|||
}
|
||||
}
|
||||
|
||||
function SelectAllRepositoriesStatus() {
|
||||
var selectAll = $('.task-contents-container .select-all-repositories');
|
||||
var all = $('.repositories-contents .sci-checkbox').length;
|
||||
var checked = $('.repositories-contents .sci-checkbox:checked').length;
|
||||
selectAllCheckboxState(selectAll, all, checked);
|
||||
}
|
||||
|
||||
function SelectAllProtocolStatus() {
|
||||
var selectAll = $('.task-contents-container .protocol-steps-checkbox');
|
||||
var all = $('.step-contents .sci-checkbox').length;
|
||||
var checked = $('.step-contents .sci-checkbox:checked').length;
|
||||
selectAllCheckboxState(selectAll, all, checked);
|
||||
}
|
||||
|
||||
function SelectAllResultsStatus() {
|
||||
var selectAll = $('.task-contents-container .all-results-checkbox');
|
||||
var all = $('.results-type-contents .sci-checkbox:not(.skip-select-all)').length;
|
||||
var checked = $('.results-type-contents .sci-checkbox:not(.skip-select-all):checked').length;
|
||||
selectAllCheckboxState(selectAll, all, checked);
|
||||
}
|
||||
|
||||
function SelectAllTaskContentStatus() {
|
||||
var selectAll = $('.task-contents-container .select-all-task-contents');
|
||||
var all = $('.report-task-settings .sci-checkbox:not(.skip-select-all)').length;
|
||||
var checked = $('.report-task-settings .sci-checkbox:not(.skip-select-all):checked').length;
|
||||
selectAllCheckboxState(selectAll, all, checked);
|
||||
}
|
||||
|
||||
|
||||
$('.task-contents-container')
|
||||
.on('change', '.select-all-task-contents', function() {
|
||||
$('.content-element .sci-checkbox:not(.skip-select-all)')
|
||||
|
@ -1363,6 +1389,15 @@ function reportHandsonTableConverter() {
|
|||
})
|
||||
.on('change', '.repositories-contents .sci-checkbox', function() {
|
||||
SelectAllRepositoriesStatus();
|
||||
})
|
||||
.on('change', '.step-contents .sci-checkbox', function() {
|
||||
SelectAllProtocolStatus();
|
||||
})
|
||||
.on('change', '.results-type-contents .sci-checkbox:not(.skip-select-all)', function() {
|
||||
SelectAllResultsStatus();
|
||||
})
|
||||
.on('change', '.report-task-settings .sci-checkbox:not(.skip-select-all)', function() {
|
||||
SelectAllTaskContentStatus();
|
||||
});
|
||||
|
||||
SelectAllRepositoriesStatus();
|
||||
|
|
Loading…
Reference in a new issue