diff --git a/Asset/js/relocate.js b/Asset/js/relocate.js index 7393b6a..14ebccd 100644 --- a/Asset/js/relocate.js +++ b/Asset/js/relocate.js @@ -53,19 +53,18 @@ // Native comment icon sits just before the description icon; if there is no // description, before the age / closed block. That is the slot we move into. - var anchor = null; - var descIcon = row.querySelector("i.fa-file-text-o"); + // NB: the description icon is wrapped in (Kanboard's + // tooltipLink), not an , so we walk up to whatever is the row's direct child. + var anchor = row.querySelector("i.fa-file-text-o") || + row.querySelector(".task-icon-age") || + row.querySelector(".task-board-closed"); - if (descIcon) { - anchor = descIcon.closest("a"); - } - - if (!anchor) { - anchor = row.querySelector(".task-icon-age") || row.querySelector(".task-board-closed"); + while (anchor && anchor.parentNode !== row) { + anchor = anchor.parentNode; } // Move only if needed (keeps the MutationObserver from looping). - if (anchor && anchor.parentNode === row && item.nextElementSibling !== anchor) { + if (anchor && anchor !== item && item.nextElementSibling !== anchor) { row.insertBefore(item, anchor); } } diff --git a/Plugin.php b/Plugin.php index d4a33c1..3df0e60 100644 --- a/Plugin.php +++ b/Plugin.php @@ -68,7 +68,7 @@ class Plugin extends Base public function getPluginVersion() { - return '1.2.0'; + return '1.2.1'; } public function getPluginHomepage() diff --git a/VERSION b/VERSION index c89b56d..b853984 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -OrganonTweaks v1.2 +OrganonTweaks v1.2.1