|
3 | 3 | :style="{
|
4 | 4 | paddingLeft: (allowShowAncestors && ancestors.length > 3 && !settings.showAllAncestors) ? '8px' : 0,
|
5 | 5 | }">
|
6 |
| - <div |
7 |
| - v-if="allowShowAncestors && ancestors.length > 3 && !settings.showAllAncestors" |
8 |
| - v-b-tooltip.hover="{ title: showAncestors ? $t('conceptDetail.showLessAncestors') : $t('conceptDetail.showAllAncestors'), delay: defaults.delay.medium }" |
9 |
| - class="button conceptDetail-ancestors-expand" |
10 |
| - @click="showAncestors = !showAncestors"> |
11 |
| - <font-awesome-icon |
12 |
| - :icon="showAncestors ? 'angle-down' : 'angle-right'" |
13 |
| - style="font-size: 12px;" /> |
| 6 | + <div v-if="broader.length < 2 && ancestors.length > 0"> |
| 7 | + <!-- Ancestors block --> |
| 8 | + <div |
| 9 | + v-if="allowShowAncestors && ancestors.length > 3 && !settings.showAllAncestors" |
| 10 | + v-b-tooltip.hover="{ title: showAncestors ? $t('conceptDetail.showLessAncestors') : $t('conceptDetail.showAllAncestors'), delay: defaults.delay.medium }" |
| 11 | + class="button conceptDetail-ancestors-expand" |
| 12 | + @click="showAncestors = !showAncestors"> |
| 13 | + <font-awesome-icon |
| 14 | + :icon="showAncestors ? 'angle-down' : 'angle-right'" |
| 15 | + style="font-size: 12px;" /> |
| 16 | + </div> |
| 17 | + <div |
| 18 | + v-for="(concept, index) in ancestors.filter(concept => concept != null).reverse()" |
| 19 | + :key="`conceptDetail-${isLeft}-ancesters-${concept.uri}-${index}`" |
| 20 | + :class="{ |
| 21 | + 'concept-mappingsExist': (showAncestors || settings.showAllAncestors || index == 0 || index == ancestors.length - 1 || ancestors.length <= 3) && loadConceptsMappedStatus && $store.getters.mappedStatus(concept, isLeft), |
| 22 | + 'concept-mappingsDoNotExist': loadConceptsMappedStatus && !$store.getters.mappedStatus(concept, isLeft) |
| 23 | + }"> |
| 24 | + <span v-if="showAncestors || settings.showAllAncestors || index == 0 || index == ancestors.length - 1 || ancestors.length <= 3"> |
| 25 | + <font-awesome-icon |
| 26 | + class="u-flip-horizontal" |
| 27 | + icon="level-up-alt" |
| 28 | + style="margin-right: 3px; font-size: 12px;" /> |
| 29 | + <item-name |
| 30 | + :item="concept" |
| 31 | + :is-link="!disallowSelectItem" |
| 32 | + :is-left="isLeft" |
| 33 | + font-size="small" /> |
| 34 | + </span> |
| 35 | + <span |
| 36 | + v-else-if="index == 1" |
| 37 | + v-b-tooltip.hover="allowShowAncestors ? { title: $t('conceptDetail.showAllAncestors'), delay: defaults.delay.medium } : null" |
| 38 | + :class="{ |
| 39 | + 'conceptDetail-ancestors-more': true, |
| 40 | + button: allowShowAncestors, |
| 41 | + }" |
| 42 | + @click="showAncestors = allowShowAncestors"> |
| 43 | + <font-awesome-icon |
| 44 | + class="u-flip-horizontal" |
| 45 | + icon="ellipsis-v" /> |
| 46 | + </span> |
| 47 | + </div> |
14 | 48 | </div>
|
15 |
| - <div |
16 |
| - v-for="(concept, index) in ancestors.filter(concept => concept != null).reverse()" |
17 |
| - :key="`conceptDetail-${isLeft}-ancesters-${concept.uri}-${index}`" |
18 |
| - :class="{ |
19 |
| - 'concept-mappingsExist': (showAncestors || settings.showAllAncestors || index == 0 || index == ancestors.length - 1 || ancestors.length <= 3) && loadConceptsMappedStatus && $store.getters.mappedStatus(concept, isLeft), |
20 |
| - 'concept-mappingsDoNotExist': loadConceptsMappedStatus && !$store.getters.mappedStatus(concept, isLeft) |
21 |
| - }"> |
22 |
| - <span v-if="showAncestors || settings.showAllAncestors || index == 0 || index == ancestors.length - 1 || ancestors.length <= 3"> |
| 49 | + <div v-else> |
| 50 | + <!-- Broader block --> |
| 51 | + <div |
| 52 | + v-for="(concept, index) in (_item.__BROADERLOADED__ ? broader : []).filter(concept => concept != null)" |
| 53 | + :key="`conceptDetail-broader-${concept.uri}-${index}`" |
| 54 | + :class="{ |
| 55 | + 'concept-mappingsExist': loadConceptsMappedStatus && $store.getters.mappedStatus(concept, isLeft), |
| 56 | + 'concept-mappingsDoNotExist': loadConceptsMappedStatus && !$store.getters.mappedStatus(concept, isLeft) |
| 57 | + }"> |
23 | 58 | <font-awesome-icon
|
24 |
| - class="u-flip-horizontal" |
25 |
| - icon="level-up-alt" |
26 |
| - style="margin-right: 3px; font-size: 12px;" /> |
| 59 | + icon="sort-up" /> |
27 | 60 | <item-name
|
28 | 61 | :item="concept"
|
29 | 62 | :is-link="!disallowSelectItem"
|
30 | 63 | :is-left="isLeft"
|
31 | 64 | font-size="small" />
|
32 |
| - </span> |
33 |
| - <span |
34 |
| - v-else-if="index == 1" |
35 |
| - v-b-tooltip.hover="allowShowAncestors ? { title: $t('conceptDetail.showAllAncestors'), delay: defaults.delay.medium } : null" |
36 |
| - :class="{ |
37 |
| - 'conceptDetail-ancestors-more': true, |
38 |
| - button: allowShowAncestors, |
39 |
| - }" |
40 |
| - @click="showAncestors = allowShowAncestors"> |
41 |
| - <font-awesome-icon |
42 |
| - class="u-flip-horizontal" |
43 |
| - icon="ellipsis-v" /> |
44 |
| - </span> |
45 |
| - </div> |
46 |
| - <!-- Broader --> |
47 |
| - <div |
48 |
| - v-for="(concept, index) in ((ancestors.length == 0 && _item.__BROADERLOADED__) ? broader : []).filter(concept => concept != null)" |
49 |
| - :key="`conceptDetail-broader-${concept.uri}-${index}`" |
50 |
| - :class="{ |
51 |
| - 'concept-mappingsExist': loadConceptsMappedStatus && $store.getters.mappedStatus(concept, isLeft), |
52 |
| - 'concept-mappingsDoNotExist': loadConceptsMappedStatus && !$store.getters.mappedStatus(concept, isLeft) |
53 |
| - }"> |
54 |
| - <font-awesome-icon |
55 |
| - icon="sort-up" /> |
56 |
| - <item-name |
57 |
| - :item="concept" |
58 |
| - :is-link="!disallowSelectItem" |
59 |
| - :is-left="isLeft" |
60 |
| - font-size="small" /> |
| 65 | + </div> |
61 | 66 | </div>
|
62 | 67 | <!-- Show LoadingIndicator when ancestors exist, but are not loaded yet -->
|
63 | 68 | <loading-indicator
|
|
0 commit comments