Skip to content

Commit

Permalink
Merge pull request #5365 from nextcloud-libraries/fix/widget-interact…
Browse files Browse the repository at this point in the history
…ive-ncrichtext

fix(NcRichText): Allow to pass interactive widget toggle
  • Loading branch information
susnux authored Mar 8, 2024
2 parents 4bb2677 + e79dbd8 commit 8dd5a3d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/NcRichText/NcReferenceWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</p>
</div>
</component>
<NcButton v-if="hasInteractiveView && !isInteractive" class="toggle-interactive--button" @click="enableInteractive">
<NcButton v-if="interactiveOptIn && hasInteractiveView && !isInteractive" class="toggle-interactive--button" @click="enableInteractive">
{{ enableLabel }}
</NcButton>
</div>
Expand Down
20 changes: 18 additions & 2 deletions src/components/NcRichText/NcRichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ export default {
type: Number,
default: 0,
},
referenceInteractive: {
type: Boolean,
default: true,
},
/** Provide data upfront to avoid extra http request */
references: {
type: Object,
Expand Down Expand Up @@ -401,7 +405,13 @@ export default {
h('div', {}, placeholders.flat()),
this.referenceLimit > 0
? h('div', { class: 'rich-text--reference-widget' }, [
h(NcReferenceList, { props: { text: this.text, referenceData: this.references } }),
h(NcReferenceList, {
props: {
text: this.text,
referenceData: this.references,
interactive: this.referenceInteractive,
},
}),
])
: null,
])
Expand Down Expand Up @@ -511,7 +521,13 @@ export default {
renderedMarkdown,
this.referenceLimit > 0
? h('div', { class: 'rich-text--reference-widget' }, [
h(NcReferenceList, { props: { text: this.text, referenceData: this.references } }),
h(NcReferenceList, {
props: {
text: this.text,
referenceData: this.references,
interactive: this.referenceInteractive,
},
}),
])
: null,
])
Expand Down

0 comments on commit 8dd5a3d

Please sign in to comment.