fix attached to moving target : keep menu entry after board refresh -- observe stable parent, not replaced #board-container (v1.0.2)

This commit is contained in:
2026-07-12 07:51:27 -03:00
parent 865f382b6d
commit 00e404dfed
3 changed files with 12 additions and 7 deletions

View File

@@ -36,16 +36,21 @@
}
function init() {
if (!document.getElementById("board")) {
var container = document.getElementById("board-container");
if (!container) {
return;
}
relocate();
var container = document.getElementById("board-container");
if (container && window.MutationObserver) {
new MutationObserver(relocate).observe(container, { childList: true, subtree: true });
// BoardDragAndDrop.refresh() does $("#board-container").replaceWith(data) on every
// drag-and-drop and poll refresh, so an observer bound to #board-container would be
// left watching a detached node and never fire again (the entry vanishes until F5).
// Observe the stable parent instead: it survives the swap, and its childList mutation
// fires exactly when the container is replaced, so relocate() re-runs on the new DOM.
if (window.MutationObserver && container.parentNode) {
new MutationObserver(relocate).observe(container.parentNode, { childList: true, subtree: true });
}
}

View File

@@ -35,7 +35,7 @@ class Plugin extends Base
public function getPluginVersion()
{
return '1.0.1';
return '1.0.2';
}
public function getPluginHomepage()

View File

@@ -1 +1 @@
BulkMoveTasks v1.0.1
BulkMoveTasks v1.0.2