{"size": 735, "ext": "js", "max_stars_repo_path": "quip/web/modules/contrib/field_permissions/js/field_permissions.js", "max_stars_repo_name": "birm/PathDB", "max_stars_repo_stars_event_min_datetime": "2018-06-08T05:44:46.000Z", "max_stars_repo_stars_event_max_datetime": "2018-08-17T17:42:23.000Z", "max_issues_repo_path": "quip/web/modules/contrib/field_permissions/js/field_permissions.js", "max_issues_repo_name": "birm/PathDB", "max_issues_repo_issues_event_min_datetime": "2018-02-21T21:42:42.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-01T11:27:06.000Z", "max_forks_repo_path": "quip/web/modules/contrib/field_permissions/js/field_permissions.js", "max_forks_repo_name": "birm/PathDB", "max_forks_repo_forks_event_min_datetime": "2019-05-23T19:38:53.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-09T11:21:47.000Z"}
{"max_stars_count": 2, "max_issues_count": 192, "max_forks_count": 5, "avg_line_length": 23.7096774194, "max_line_length": 74, "alphanum_fraction": 0.5401360544}
/**
 * @file
 * Hide the permissions grid for all field permission types except custom.
 */

(function ($) {

  Drupal.behaviors.fieldPermissions = {
    attach: function (context, settings) {

      var PemTable = $(context).find('#permissions');
      var PermDefaultType = $(context).find('#edit-type input:checked');
      var PermInputType = $(context).find('#edit-type input');
      /*init*/
      if (PermDefaultType.val() != 'custom') {
        PemTable.hide();
      }
      /*change*/
      PermInputType.on('change', function () {
        var typeVal = $(this).val();
        if (typeVal != 'custom') {
          PemTable.hide();
        }
        else {
          PemTable.show();
        }
      });

    }};
})(jQuery);
