Files
WorkspaceOrg/Asset/js/workspaceorg.js

27 lines
819 B
JavaScript

/*
* WorkspaceOrg -- submit the per-project "move to workspace" form when its dropdown changes.
*
* Kanboard's default CSP is `default-src 'self'` (no 'unsafe-inline' for scripts), so an inline
* onchange="" attribute is blocked and does nothing. The change handler must live in an external
* script served from 'self', which is what this file is.
*/
(function () {
"use strict";
function init() {
var selects = document.querySelectorAll(".wso-move-form select");
for (var i = 0; i < selects.length; i++) {
selects[i].addEventListener("change", function () {
this.form.submit();
});
}
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
} else {
init();
}
})();