discourse/app/assets/javascripts/discourse/scripts/activate-account.js
David Taylor a084680f1d
DEV: Pass static scripts through Ember CLI (#17373)
All files under `app/assets/javascripts/scripts` will be run through babel, given sourcemaps, and output under `/assets/{name}.js`. This is another step towards removing our sprockets dependence.
2022-07-08 10:13:46 +01:00

20 lines
638 B
JavaScript

(function () {
setTimeout(function () {
const $activateButton = $("#activate-account-button");
$activateButton.on("click", function () {
$activateButton.prop("disabled", true);
const hpPath = document.getElementById("data-activate-account").dataset
.path;
$.ajax(hpPath)
.then(function (hp) {
$("#password_confirmation").val(hp.value);
$("#challenge").val(hp.challenge.split("").reverse().join(""));
$("#activate-account-form").submit();
})
.fail(function () {
$activateButton.prop("disabled", false);
});
});
}, 50);
})();