Skip to content

Commit

Permalink
Ensure cancel button works on new forms without js-no-signin.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Oct 15, 2023
1 parent 0c32bb0 commit 59db16e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -10892,10 +10892,12 @@ function transfer_form_values($dst, $src, names) {

// login UI
handle_ui.on("js-signin", function (evt) {
var form = this, signin = document.getElementById("k-signin");
signin && (signin.disabled = true);
evt.preventDefault();
$.get(hoturl("api/session"), function () { form.submit() });
if (form_submitter(this, evt) !== "cancel") {
const form = this, signin = document.getElementById("k-signin");
signin && (signin.disabled = true);
evt.preventDefault();
$.get(hoturl("api/session"), function () { form.submit() });
}
});

handle_ui.on("js-no-signin", function () {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/p_signin.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ function reset_request(Contact $user, Qrequest $qreq, $cs) {
// exit on cancel
if ($qreq->cancel) {
$info = ["ok" => false];
foreach ($cs->members("reset/request") as $gj) {
foreach ($cs->members("resetpassword/request") as $gj) {
$info = $cs->call_function($gj, $gj->reset_function, $info, $gj);
}
$conf->redirect();
Expand Down

0 comments on commit 59db16e

Please sign in to comment.