Sha256: 0edee270d79e75784622e020f4645278a6eeb77c8b4e1ff1968f11e466572d0b

Contents?: true

Size: 961 Bytes

Versions: 13

Compression:

Stored size: 961 Bytes

Contents

$(() => {
  const $modal = $("#show-email-modal");

  if ($modal.length === 0) {
    return
  }

  const $button = $("[data-open=user_email]", $modal);
  const $email = $("#user_email", $modal);
  const $fullName = $("#user_full_name", $modal);

  $("[data-dialog-open=show-email-modal]").on("click", (event) => {
    event.preventDefault()

    $button.show()
    $button.attr("data-remote-url", event.currentTarget.href)
    $fullName.text($(event.currentTarget).data("full-name"))
    $email.html("");
  })

  /* eslint-disable */
  async function getUserEmail(url) {
    let response = await fetch(url);
    if (response.ok) {
      let userEmail = await response.text();
      $("#user_email").html(userEmail);
      $button.hide()
    } else {
      console.log(`Error-HTTP: " + ${response.status}`);
    }
  }
  /* eslint-enable */

  $("[data-open=user_email]").on("click", (event) => {
    getUserEmail(event.currentTarget.dataset.remoteUrl);
  })

})

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.28.4 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.29.0 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.28.3 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.29.0.rc4 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.29.0.rc3 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.29.0.rc2 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.29.0.rc1 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.28.2 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.28.1 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.28.0 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.28.0.rc5 app/packs/src/decidim/admin/officializations.js
decidim-admin-0.28.0.rc4 app/packs/src/decidim/admin/officializations.js