Skip to content

Commit

Permalink
Merge pull request #6151 from nextcloud-libraries/feat/noid/reference…
Browse files Browse the repository at this point in the history
…-fixups
  • Loading branch information
Antreesy authored Oct 18, 2024
2 parents 05cb6c9 + 98b4fc9 commit 6305066
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
15 changes: 7 additions & 8 deletions src/components/NcRichText/NcReferenceList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

<template>
<div v-if="isVisible" class="widgets--list" :class="{'icon-loading': loading }">
<div v-for="reference in displayedReferences" :key="reference?.openGraphObject?.id">
<NcReferenceWidget :reference="reference" :interactive="interactive" :interactive-opt-in="interactiveOptIn" />
</div>
<NcReferenceWidget v-for="reference in displayedReferences"
:key="reference?.openGraphObject?.id"
:reference="reference"
:interactive="interactive"
:interactive-opt-in="interactiveOptIn" />
</div>
</template>
<script>
Expand Down Expand Up @@ -146,11 +148,8 @@ export default {
}
</script>
<style lang="scss" scoped>
.widget--list {
width: var(--widget-full-width, 100%);
}

.widgets--list.icon-loading {
.widgets--list {
width: 100%;
min-height: var(--default-clickable-area);
}
</style>
14 changes: 3 additions & 11 deletions src/components/NcRichText/NcReferenceWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export default {
margin-top: calc(var(--default-grid-baseline, 4px) * 3);
overflow: hidden;
border: 2px solid var(--color-border);
border-radius: var(--border-radius-large);
border-radius: var(--border-radius-container);
background-color: transparent;
display: flex;
}
Expand Down Expand Up @@ -317,17 +317,9 @@ export default {
position: relative;
.toggle-interactive--button {
position: absolute;
top: 50%;
bottom: var(--default-grid-baseline);
right: var(--default-grid-baseline);
z-index: 10000;
left: 50%;
transform: translateX(-50%) translateY(-50%);
opacity: 0;
}

&:focus-within, &:hover {
.toggle-interactive--button {
opacity: 1;
}
}
}
</style>
6 changes: 6 additions & 0 deletions src/components/NcRichText/NcRichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ export default {
type: Boolean,
default: true,
},
referenceInteractiveOptIn: {
type: Boolean,
default: false,
},
/** Provide data upfront to avoid extra http request */
references: {
type: Object,
Expand Down Expand Up @@ -419,6 +423,7 @@ export default {
text: this.text,
referenceData: this.references,
interactive: this.referenceInteractive,
interactiveOptIn: this.referenceInteractiveOptIn,
},
}),
])
Expand Down Expand Up @@ -544,6 +549,7 @@ export default {
text: this.text,
referenceData: this.references,
interactive: this.referenceInteractive,
interactiveOptIn: this.referenceInteractiveOptIn,
},
}),
])
Expand Down

0 comments on commit 6305066

Please sign in to comment.