diff --git a/Asset/js/relocate.js b/Asset/js/relocate.js index 4630931..7393b6a 100644 --- a/Asset/js/relocate.js +++ b/Asset/js/relocate.js @@ -77,16 +77,21 @@ } function init() { - if (!document.getElementById("board")) { + var container = document.getElementById("board-container"); + if (!container) { return; } apply(); - var container = document.getElementById("board-container"); + // Observe the STABLE parent, not #board-container: Kanboard replaces the container + // on every card drop / AJAX poll (BoardDragAndDrop.refresh), which would kill an + // observer bound to the container itself and leave the items un-relocated after a + // move. The parent survives, so apply() keeps running on every rebuild. + var parent = container.parentNode; - if (container && window.MutationObserver) { - new MutationObserver(apply).observe(container, { childList: true, subtree: true }); + if (parent && window.MutationObserver) { + new MutationObserver(apply).observe(parent, { childList: true, subtree: true }); } } diff --git a/Plugin.php b/Plugin.php index 6b95185..395f2db 100644 --- a/Plugin.php +++ b/Plugin.php @@ -60,7 +60,7 @@ class Plugin extends Base public function getPluginVersion() { - return '1.0.0'; + return '1.1.0'; } public function getPluginHomepage() diff --git a/VERSION b/VERSION index 1b8385b..f9d8c55 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -OrganonTweaks v1.0 +OrganonTweaks v1.1