Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make the witnesses wrapper with flex-wrap css prop #517

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/components/annotations/variants/VariantsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,21 @@ function getWitnessColor(witness: string) {
}

function getVariantsListInfoMessage(): string {
if (annotationStore.filteredAnnotations.length === 0) {
return i18n[lang.value]['no_annotations_in_view']
}
if (annotationStore.isSingleSelectMode) {
if (annotationStore.isSingleSelectMode
&& annotationStore.filteredAnnotations.length > 0) {
return i18n[lang.value]['single_select_mode_info_message']
}
return i18n[lang.value]['no_annotations_in_view']
}

function getVariantsListInfoTitle(): string {
if (annotationStore.filteredAnnotations.length === 0) {
return i18n[lang.value]['no_annotations_available']
}
if (annotationStore.isSingleSelectMode) {
if (annotationStore.isSingleSelectMode
&& annotationStore.filteredAnnotations.length > 0) {
return i18n[lang.value]['single_select_mode']
}
return i18n[lang.value]['no_annotations_available']
}


function showLineSeparator(visibleAnnotations, i) {
if (visibleAnnotations[i+1]) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export function addWitness(target, witness, color) {

function createWitnessesWrapper() {
const el = document.createElement("span");
el.classList.add('witnesses')
el.classList.add('witnesses', 't-inline-flex', 't-flex-wrap')

return el
}
Expand All @@ -281,7 +281,7 @@ function createWitnessEl(witness, witnessColor) {
// create an html element of one witness
const el = document.createElement("span");
el.innerHTML = witness
el.classList.add('t-rounded-3xl', 't-box-border', 't-h-8', 't-py-0.5', 't-px-1.5', 't-text-xs', 't-font-semibold', 't-font-sans', 't-ml-[3px]')
el.classList.add('t-rounded-3xl', 't-box-border', 't-py-0.5', 't-px-1.5', 't-text-xs', 't-font-semibold', 't-font-sans', 't-ml-[3px]')
el.style.background = colors[witnessColor]['100']
el.style.color = colors[witnessColor]['600']

Expand Down
Loading