fix comment "+" position: anchor on description span (tooltipLink), not <a>, so it sits left; v1.2.1
This commit is contained in:
@@ -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 <span class="tooltip"> (Kanboard's
|
||||
// tooltipLink), not an <a>, 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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user