Sha256: 36424bfa4f3dd934512156db1800351cbb69d298baeba782cef93a32005cc95c

Contents?: true

Size: 1.23 KB

Versions: 58

Compression:

Stored size: 1.23 KB

Contents

(() => {
  const $scope = $("#promoting-committee-details");

  const $promotingCommitteeCheckbox = $(
    "#initiatives_type_promoting_committee_enabled",
    $scope
  );

  const $signatureType = $("#initiatives_type_signature_type");

  const $collectUserDataCheckbox = $("#initiatives_type_collect_user_extra_fields");

  const toggleVisibility = () => {
    if ($promotingCommitteeCheckbox.is(":checked")) {
      $(".minimum-committee-members-details", $scope).show();
    } else {
      $(".minimum-committee-members-details", $scope).hide();
    }

    if ($signatureType.val() === "offline") {
      $("#initiatives_type_undo_online_signatures_enabled").parent().parent().hide();
    } else {
      $("#initiatives_type_undo_online_signatures_enabled").parent().parent().show();
    }

    if ($collectUserDataCheckbox.is(":checked")) {
      $("#initiatives_type-extra_fields_legal_information-tabs").parent().parent().show()
    } else {
      $("#initiatives_type-extra_fields_legal_information-tabs").parent().parent().hide()
    }
  };

  $($promotingCommitteeCheckbox).click(() => toggleVisibility());
  $($signatureType).change(() => toggleVisibility());
  $($collectUserDataCheckbox).click(() => toggleVisibility());

  toggleVisibility();
})();

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
decidim-initiatives-0.26.8 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.27.4 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.27.3 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.26.7 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.26.5 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.27.2 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.27.1 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.26.4 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.27.0 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.26.3 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.27.0.rc2 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.27.0.rc1 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.26.2 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.26.1 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.26.0 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.26.0.rc2 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.26.0.rc1 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.25.2 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.25.1 app/packs/src/decidim/initiatives/admin/initiatives_types.js
decidim-initiatives-0.25.0 app/packs/src/decidim/initiatives/admin/initiatives_types.js