Skip to content

Commit

Permalink
fix: add cancel button
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Danzberger <[email protected]>
  • Loading branch information
elzody committed Sep 9, 2024
1 parent fd4b1f3 commit 920c2c0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/view/DocumentTargetPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<template>
<div v-if="filePath === null" class="office-target-picker">
<div ref="picker" class="reference-file-picker" />
<div class="reference-file-picker" />
</div>
<div v-else class="office-target-picker">
<h2>{{ t('richdocuments', 'Link to office document section') }}</h2>
Expand Down Expand Up @@ -96,6 +96,13 @@ export default {
},
async openFilePicker() {
const filePickerButtons = [
{
label: t('richdocuments', 'Cancel'),
callback: () => {
this.$emit('cancel')
},
type: 'secondary',
},
{
label: t('richdocuments', 'Select file'),
callback: (files) => {
Expand All @@ -114,7 +121,7 @@ export default {
mimetypeFilter: getCapabilities().mimetypes,
allowPickDirectory: false,
buttons: filePickerButtons,
container: '.office-target-picker',
container: '.reference-file-picker',
})
},
setTarget(entry) {
Expand Down

0 comments on commit 920c2c0

Please sign in to comment.