Skip to content

Commit

Permalink
create function for highlight bubbles
Browse files Browse the repository at this point in the history
  • Loading branch information
mart2070 committed Feb 3, 2025
1 parent d2460d2 commit 6e60b94
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions tdx-enhanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,26 @@
}

updateHeading(t.parentElement,numItems,totalItems)
}

console.log("Items:",items)
}
function createHighlightBubble(element,bgColor,txtColor) {

//should the bubble carry links over?
//let copy = element.cloneNode(true)

//create new element to highlight
let newSpan = document.createElement("span")
newSpan.innerText = element.innerText //item["2285"].txt
newSpan.style.backgroundColor = bgColor
newSpan.style.color = txtColor
newSpan.classList.add("qHighlight")

//if we use the copy method
//newSpan.appendChild(copy)

//replace cell with new span
element.replaceChildren(newSpan)
return newSpan
}

//modify/color the cells
Expand All @@ -414,15 +431,7 @@
if (qTxt in colorsByQueue) {
let q = colorsByQueue[qTxt]

//create new element to highlight
let newSpan = document.createElement("span")
newSpan.innerText = item["2285"].txt
newSpan.style.backgroundColor = q.bg
newSpan.style.color = q.txt
newSpan.classList.add("qHighlight")

//replace cell with new span
qCell.replaceChildren(newSpan)
createHighlightBubble(qCell,q.bg,q.txt)
}
}

Expand Down Expand Up @@ -1482,6 +1491,7 @@
.qHighlight {
padding: 4px;
border-radius: 8px;
white-space: nowrap;
}
.select2-container-active .select2-choice, .select2-container-multi.select2-container-active .select2-choices {
Expand Down

0 comments on commit 6e60b94

Please sign in to comment.