move select via external JS (CSP fix); rows show id/owner/config + ws counts
This commit is contained in:
26
Asset/js/workspaceorg.js
Normal file
26
Asset/js/workspaceorg.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user