summaryrefslogtreecommitdiffstats
path: root/app/views/principal_memberships/new.js.erb
blob: 625eeaf68dc4e1262fc2205eed5b3bff8fa605a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'principal_memberships/new_modal') %>');
showModal('ajax-modal', '700px');

$('.projects-selection').on('click', 'input[type=checkbox]', function(e){
  if (!$(this).is(':checked')) {
    if ($(this).closest('li').find('ul input[type=checkbox]:not(:checked)').length > 0) {
      $(this).closest('li').find('ul input[type=checkbox]:not(:checked)').attr('checked', 'checked');
      e.preventDefault();
    } else {
      $(this).closest('li').find('ul input[type=checkbox]:checked').removeAttr('checked');
    }
  }
});