Sha256: d0f8bae828c2ddecbae027a4107ee41dd3417129f1e6ef3fa524fbbba71e25ae

Contents?: true

Size: 559 Bytes

Versions: 7

Compression:

Stored size: 559 Bytes

Contents

$(() => {
  window.DecidimProposals = window.DecidimProposals || {};

  window.DecidimProposals.bindProposalAddress = () => {
    const $checkbox = $("input:checkbox.has_address");
    const $addressInput = $("#address_input");

    if ($checkbox.length > 0) {
      const toggleInput = () => {
        if ($checkbox[0].checked) {
          $addressInput.show();
        } else {
          $addressInput.hide();
        }
      }
      toggleInput();
      $checkbox.on("change", toggleInput);
    }
  };

  window.DecidimProposals.bindProposalAddress();
});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-proposals-0.15.2 app/assets/javascripts/decidim/proposals/add_proposal.js.es6
decidim-proposals-0.15.1 app/assets/javascripts/decidim/proposals/add_proposal.js.es6
decidim-proposals-0.15.0 app/assets/javascripts/decidim/proposals/add_proposal.js.es6
decidim-proposals-0.14.4 app/assets/javascripts/decidim/proposals/add_proposal.js.es6
decidim-proposals-0.14.3 app/assets/javascripts/decidim/proposals/add_proposal.js.es6
decidim-proposals-0.14.2 app/assets/javascripts/decidim/proposals/add_proposal.js.es6
decidim-proposals-0.14.1 app/assets/javascripts/decidim/proposals/add_proposal.js.es6