v1.8.1 stage D button save & close unnecessary bugfix

This commit is contained in:
2026-07-10 18:26:44 -03:00
parent 269964d4cc
commit 2d3c716852
7 changed files with 2 additions and 99 deletions

View File

@@ -1,39 +0,0 @@
/*
* OrganonTweaks -- the "Save & Close" button on the task edit form. It is a plain type=button (so it
* never becomes the Enter default -- Enter still triggers the core Save), and on click it repoints
* the form to the plugin's TaskSaveCloseController and lets Kanboard's own modal submit it. Kanboard
* keeps ownership of the POST, CSRF, error re-render, and the X-Ajax-Redirect navigation; we only
* change the destination, so the controller redirects to the board instead of the card view.
*/
(function () {
"use strict";
document.addEventListener("click", function (e) {
if (!e.target || !e.target.closest) {
return;
}
var btn = e.target.closest("[data-organon-save-close]");
if (!btn) {
return;
}
e.preventDefault();
var form = btn.closest("form");
var url = btn.getAttribute("data-url");
if (!form || !url) {
return;
}
form.setAttribute("action", url);
if (window.KB && KB.modal && KB.modal.isOpen && KB.modal.isOpen() && KB.modal.submitForm) {
KB.modal.submitForm();
} else if (form.requestSubmit) {
form.requestSubmit();
} else {
form.submit();
}
}, false);
})();