mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
assessmentsAverage: Fix weight display upon setting override
This commit is contained in:
@@ -83,24 +83,29 @@ function createWeightLabel(
|
||||
weighting: string | undefined,
|
||||
) {
|
||||
let statsContainer = assessmentItem.querySelector(
|
||||
`[class*='AssessmentItem__stats___']`,
|
||||
`[class*='AssessmentItem__stats___'], .betterseqta-stats-container`,
|
||||
) as HTMLElement | null;
|
||||
|
||||
if (!statsContainer) {
|
||||
const statsClass = getClassByPattern(document, "AssessmentItem__stats___");
|
||||
statsContainer = document.createElement("div");
|
||||
statsContainer.className = statsClass;
|
||||
statsContainer.style.justifyContent = "flex-end";
|
||||
statsContainer.classList.add("betterseqta-stats-container");
|
||||
const thermoscore = assessmentItem.querySelector(`[class*='Thermoscore__Thermoscore___']`);
|
||||
if (thermoscore) {
|
||||
thermoscore.insertAdjacentElement("afterend", statsContainer);
|
||||
} else {
|
||||
assessmentItem.appendChild(statsContainer);
|
||||
}
|
||||
} else {
|
||||
statsContainer.style.justifyContent = "space-between";
|
||||
}
|
||||
|
||||
const hasNativeLabel = !!statsContainer.querySelector(
|
||||
`[class*='Label__Label___']:not(.betterseqta-weight-label)`,
|
||||
);
|
||||
statsContainer.style.justifyContent = hasNativeLabel
|
||||
? "space-between"
|
||||
: "flex-end";
|
||||
|
||||
const displayText =
|
||||
weighting && weighting !== "processing" && weighting !== "N/A"
|
||||
? `${Number(weighting) % 1 === 0 ? Number(weighting) : weighting}%`
|
||||
|
||||
Reference in New Issue
Block a user