{"size": 583, "ext": "js", "max_stars_repo_path": "src/chains/static/admin/js/limit_message_choices.js", "max_stars_repo_name": "tough-dev-school/education-backend", "max_stars_repo_stars_event_min_datetime": "2021-09-22T18:38:26.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-29T06:09:42.000Z", "max_issues_repo_path": "src/chains/static/admin/js/limit_message_choices.js", "max_issues_repo_name": "tough-dev-school/education-backend", "max_issues_repo_issues_event_min_datetime": "2021-09-16T07:17:31.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-26T12:06:58.000Z", "max_forks_repo_path": "src/chains/static/admin/js/limit_message_choices.js", "max_forks_repo_name": "tough-dev-school/education-backend", "max_forks_repo_forks_event_min_datetime": "2021-10-17T17:43:31.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-26T11:22:45.000Z"}
{"max_stars_count": 62, "max_issues_count": 50, "max_forks_count": 16, "avg_line_length": 27.7619047619, "max_line_length": 64, "alphanum_fraction": 0.5728987993}
(function($) {
  $(document).ready(() => {
    var $chain = $('#message_form select#id_chain');
    var $parent = $('#message_form select#id_parent');

    function updateMessageSelector() {
      const chainLabel = $chain.find('option:checked')[0].label;
      $parent.find('option').each(function() {
        if (this.label.startsWith(chainLabel)) {
          $(this).attr('disabled', false);
        } else {
          $(this).attr('disabled', true);
        }
      });
    }
    $chain.on('change', updateMessageSelector);

    updateMessageSelector();
  });
})(django.jQuery);
