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