Skip to content

Commit

Permalink
Merge pull request #8638 from nextcloud/focus-trap-ckeditor-signature
Browse files Browse the repository at this point in the history
fix: make nested toolbar working for signature editor
  • Loading branch information
kesselb authored Jul 21, 2023
2 parents a5fa367 + 8c0965c commit 69d8952
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/components/AccountSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<AppSettingsDialog id="app-settings-dialog"
:open="open"
:show-navigation="true"
:additional-trap-elements="trapElements"
@update:open="updateOpen">
<AppSettingsSection
id="account-settings"
Expand All @@ -41,7 +42,7 @@
<p class="settings-hint">
{{ t('mail', 'A signature is added to the text of new messages and replies.') }}
</p>
<SignatureSettings :account="account" />
<SignatureSettings :account="account" @show-toolbar="handleShowToolbar" />
</AppSettingsSection>
<AppSettingsSection id="writing-mode" :title="t('mail', 'Writing mode')">
<p class="settings-hint">
Expand Down Expand Up @@ -146,6 +147,11 @@ export default {
default: false,
},
},
data() {
return {
trapElements: [],
}
},
computed: {
menu() {
return this.buildMenu()
Expand All @@ -171,6 +177,9 @@ export default {
updateOpen() {
this.$emit('update:open')
},
handleShowToolbar(element) {
this.trapElements.push(element)
},
},
}
</script>
Expand Down
6 changes: 5 additions & 1 deletion src/components/SignatureSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
v-model="signature"
:html="true"
:placeholder="t('mail', 'Signature …')"
:bus="bus" />
:bus="bus"
@show-toolbar="handleShowToolbar" />
<p v-if="isLargeSignature" class="warning-large-signature">
{{ t('mail', 'Your signature is larger than 2 MB. This may affect the performance of your editor.') }}
</p>
Expand Down Expand Up @@ -180,6 +181,9 @@ export default {
throw error
})
},
handleShowToolbar(event) {
this.$emit('show-toolbar', event)
},
},
}
</script>
Expand Down

0 comments on commit 69d8952

Please sign in to comment.