Browse Source

Add jquery implementation on selecting child task trigger selecting job for better logic

pull/46/head
Muhammad Irwan Andriawan 6 years ago
parent
commit
f5307c5608
No known key found for this signature in database GPG Key ID: EDE1CC7FF1BA6212
  1. 22
      resources/views/projects/jobs/add-from-other-project.blade.php

22
resources/views/projects/jobs/add-from-other-project.blade.php

@ -75,9 +75,31 @@
@if ($selectedProject)
@foreach ($selectedProject->jobs as $job)
$('#job_id_{{ $job->id }}').change(function () {
$('.job_id_{{ $job->id }}_tasks').prop('checked', this.checked);
});
@foreach($job->tasks as $task)
$('#{{ $job->id }}_task_id_{{ $task->id }}').change(function () {
var condition = false;
$.each($(".job_id_{{ $job->id }}_tasks"), function( key, value ) {
if(value.checked == true){
condition = true
}
});
if(condition == true){
$('#job_id_{{ $job->id }}').prop('checked', true);
}
});
@endforeach
@endforeach
@endif
})();

Loading…
Cancel
Save