Skip to content

Commit

Permalink
feat: add the button for variants detail
Browse files Browse the repository at this point in the history
  • Loading branch information
malkja committed Aug 1, 2024
1 parent 4e85b24 commit a5a0bd2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
12 changes: 6 additions & 6 deletions examples/ahiqar-arabic-karshuni-with-variants-local.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,19 @@
"types": [
{
"name": "Person",
"icon": "biPersonFill"
"icon": "person"
},
{
"name": "Place",
"icon": "biGeoAltFill"
"icon": "marker"
},
{
"name": "Editorial Comment",
"icon": "biChatFill"
"icon": "chat"
},
{
"name": "Reference",
"icon": "biBoxArrowUpRight"
"icon": "externalLink"
}
]
}
Expand All @@ -141,7 +141,7 @@
"types": [
{
"name": "Motif",
"icon": "biPenFill"
"icon": "pen"
}
]
}
Expand All @@ -156,7 +156,7 @@
"types": [
{
"name": "Variant",
"icon": "biPenFill"
"icon": "pen"
}
]
}
Expand Down
10 changes: 9 additions & 1 deletion src/components/annotations/AnnotationVariantItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
<span v-if="variant.witness" v-html="variant.witness" class="t-text-sm"/>
<span v-else class="t-text-sm"> - </span>
</div>
<span v-html="variant.entry" class="t-absolute t-right-[50%]"/>
<span v-html="variant.entry" class="t-absolute t-ml-[150px]"/>
<button class="t-bg-blue-500 t-hover:bg-blue-700 t-text-white t-text-sm t-font-bold t-py-1 t-px-2 t-rounded-full t-absolute t-ml-[250px]"
@click="openVariantsModel()">
Open detail
</button>
</div>
</template>

Expand All @@ -24,6 +28,10 @@ function getCurrentVariantItemColor(index){
return colors()[index]
}
function openVariantsModel(){
console.log('open the variants modal')
}
export interface Props {
annotation: Annotation,
Expand Down
2 changes: 0 additions & 2 deletions src/utils/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ export function addWitness(element, annotation) {
const numberVariantItems = Object.keys(variantItemsList).length
const hexaDecimalColors = colors().slice(0, numberVariantItems)


//let prevElement = element;
let i = 0;
variantItemsList.forEach((variantItem) => {
Expand All @@ -259,7 +258,6 @@ export function addWitness(element, annotation) {
parentOfElement.insertBefore(witHtmlElement, parentOfElement.children[indexOfElement]);
});
//element.after(witnessesHtml)

}

export function removeWitness(selector, removeAnnotation) {
Expand Down

0 comments on commit a5a0bd2

Please sign in to comment.