Skip to content

Commit

Permalink
Vocabulary view: Deselect concept when switching from Content tab (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Oct 16, 2024
1 parent c2d68dc commit 1c74470
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions views/vocabulary.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@
},
}
function changeTab(id) {
// Deselect concept via Vue component (workaround)
if (id !== 2 && window.selectConcept) {
window.selectConcept(null)
}
lists.links.forEach((element, key) => {
if (key === id) {
element.classList.add("active")
Expand Down
5 changes: 5 additions & 0 deletions vue/components/ConceptBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ export default {
},
},
async mounted() {
// Define global method to select concept, even from EJS template
window.selectConcept = (concept) => {
this.selected = concept
}
const { scheme } = this
// Get URI for selected concept from URL
Expand Down

0 comments on commit 1c74470

Please sign in to comment.