Show description in hover bar

This commit is contained in:
Ajay Ramachandran
2021-11-06 19:57:46 -04:00
parent 4a2ebe4b03
commit 33cfe3f5d3
2 changed files with 9 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ export interface PreviewBarSegment {
category: Category;
unsubmitted: boolean;
showLarger: boolean;
description: string;
}
class PreviewBar {
@@ -129,10 +130,11 @@ class PreviewBar {
} else if (segment !== null) {
this.tooltipContainer.classList.add(TOOLTIP_VISIBLE_CLASS);
const name = segment.description || utils.shortCategoryName(segment.category);
if (segment.unsubmitted) {
this.categoryTooltip.textContent = chrome.i18n.getMessage("unsubmitted") + " " + utils.shortCategoryName(segment.category);
this.categoryTooltip.textContent = chrome.i18n.getMessage("unsubmitted") + " " + name;
} else {
this.categoryTooltip.textContent = utils.shortCategoryName(segment.category);
this.categoryTooltip.textContent = name;
}
// Use the class if the timestamp text uses it to prevent overlapping