Skip to content

Commit

Permalink
Completely remove popover from ItemName (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Mar 31, 2023
1 parent 3ecee2f commit 685cb1c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 68 deletions.
62 changes: 0 additions & 62 deletions src/components/ItemName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
<div
:is="isValidLink ? 'router-link' : 'div'"
:id="tooltipDOMID"
v-b-popover="_showPopover ? {
placement: 'top',
trigger: 'hover',
content: `${popoverHTML}`,
html: true,
boundary: 'window',
delay: defaults.delay.long,
} : null"
:to="url"
class="itemName-inner"
:class="[
Expand Down Expand Up @@ -51,21 +43,6 @@
class="missingDataIndicator">
</div>
<!-- Content for popover -->
<div
v-if="_showPopover && isHoveredFromHere"
:id="tooltipDOMID + '-contentMap'"
style="display: none">
<div style="max-height: 400px; overflow: auto;">
<!-- Ancestors / Broader -->
<concept-detail-ancestors
:item="item"
:is-left="isLeft"
:allow-show-ancestors="false"
style="margin-bottom: 5px;" />
<content-map :content-map="contentMap" />
</div>
</div>
</div>
</template>

Expand All @@ -74,16 +51,12 @@ import _ from "lodash"
import dragandrop from "@/mixins/dragandrop.js"
import { getItem } from "@/items"
import ContentMap from "./ContentMap.vue"
import ConceptDetailAncestors from "./ConceptDetailAncestors.vue"
import { mainLanguagesContentMapForConcept } from "@/utils/concept-helpers"
/**
* Component that displays an item's notation (if defined) and prefLabel.
*/
export default {
name: "ItemName",
components: { ContentMap, ConceptDetailAncestors },
mixins: [dragandrop],
props: {
/**
Expand Down Expand Up @@ -128,13 +101,6 @@ export default {
type: Boolean,
default: true,
},
/**
* Determines whether to show some concept details as a popover.
*/
showPopover: {
type: Boolean,
default: false,
},
/**
* Determines whether the item is highlighted
*/
Expand Down Expand Up @@ -174,8 +140,6 @@ export default {
url: "",
isValidLink: false,
interval: null,
// We are using this inside a v-b-popover directive. To have up-to-date data, it is set on hover.
popoverHTML: "",
}
},
computed: {
Expand All @@ -201,25 +165,6 @@ export default {
isScheme() {
return this.$jskos.isScheme(this._item)
},
// Content for popover with ContentMap component
contentMap() {
const contentMap = mainLanguagesContentMapForConcept(this._item)
Object.values(contentMap).filter(map => map.props.includes("prefLabel")).forEach(map => {
map.classes = "fontWeight-heavy"
})
return contentMap
},
_showPopover() {
return this.showPopover && (!this.showText || !this._showNotation || Object.values(this.contentMap).length)
},
},
watch: {
_item() {
if (this.popoverHTML) {
// When item is updated and popoverHTML is set, update it
this.updatePopoverHTML()
}
},
},
created() {
this.hovering = _.debounce(this._hovering, 20)
Expand Down Expand Up @@ -250,8 +195,6 @@ export default {
window.clearInterval(this.interval)
}
}, 500)
// Set popover HTML
this.updatePopoverHTML()
} else {
this.isHoveredFromHere = false
this.$store.commit({
Expand All @@ -261,11 +204,6 @@ export default {
window.clearInterval(this.interval)
}
},
updatePopoverHTML() {
this._showPopover && this.$nextTick(() => {
this.popoverHTML = document.getElementById(this.tooltipDOMID + "-contentMap").innerHTML
})
},
},
}
Expand Down
4 changes: 0 additions & 4 deletions src/components/MappingBrowserTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
v-if="!$jskos.isContainedIn(concept, loadingConcepts)"
:item="concept"
:show-text="false"
:show-popover="true"
:is-link="true"
:is-left="true"
:is-highlighted="$jskos.compare(concept, selected.concept[true]) || $jskos.compare(concept, selected.concept[false])" />
Expand All @@ -66,7 +65,6 @@
v-if="!$jskos.isContainedIn(concept, loadingConcepts)"
:item="concept"
:show-text="true"
:show-popover="true"
:is-link="true"
:is-left="true"
:is-highlighted="$jskos.compare(concept, selected.concept[true]) || $jskos.compare(concept, selected.concept[false])" />
Expand Down Expand Up @@ -113,7 +111,6 @@
<item-name
:item="concept"
:show-text="false"
:show-popover="true"
:is-link="true"
:is-left="false"
:is-highlighted="$jskos.compare(concept, selected.concept[false]) || $jskos.compare(concept, selected.concept[true])" /><br>
Expand All @@ -139,7 +136,6 @@
<item-name
:item="concept"
:show-text="true"
:show-popover="true"
:is-link="true"
:is-left="false"
:is-highlighted="$jskos.compare(concept, selected.concept[false]) || $jskos.compare(concept, selected.concept[true])" /><br>
Expand Down
1 change: 0 additions & 1 deletion src/components/MappingEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
:is-link="true"
:is-left="isLeft"
:is-highlighted="$jskos.compare(concept, selected.concept[true]) || $jskos.compare(concept, selected.concept[false])"
:show-popover="true"
font-size="large" />
<!-- Delete button for concept -->
<span
Expand Down
1 change: 0 additions & 1 deletion src/components/TheNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
icon: 'recycle'
}]"
:show-labels="true"
:show-popover="false"
:show-registry="true"
:hide-duplicates="false"
style="width: 700px;"
Expand Down

0 comments on commit 685cb1c

Please sign in to comment.