diff --git a/apps/files_sharing/js/dist/files_sharing_tab.js b/apps/files_sharing/js/dist/files_sharing_tab.js index 17c58e2815c23f86ecf5c5e76b5018effeab4d4a..078b46061aa120f90d18bfa12e91b388b9db58b3 100644 Binary files a/apps/files_sharing/js/dist/files_sharing_tab.js and b/apps/files_sharing/js/dist/files_sharing_tab.js differ diff --git a/apps/files_sharing/js/dist/files_sharing_tab.js.map b/apps/files_sharing/js/dist/files_sharing_tab.js.map index 08c1e44b06e444e8831f1b12478be90b2226e2f0..7f23a1c987d3d75d787615bc9aebd9eaffc265f4 100644 Binary files a/apps/files_sharing/js/dist/files_sharing_tab.js.map and b/apps/files_sharing/js/dist/files_sharing_tab.js.map differ diff --git a/apps/files_sharing/js/dist/personal-settings.js b/apps/files_sharing/js/dist/personal-settings.js index 1075e744f1ebbb87fc314d93ed96079c03c14adb..5bec5ca76954e694229debff8f449a1ac592208d 100644 Binary files a/apps/files_sharing/js/dist/personal-settings.js and b/apps/files_sharing/js/dist/personal-settings.js differ diff --git a/apps/files_sharing/js/dist/personal-settings.js.map b/apps/files_sharing/js/dist/personal-settings.js.map index f468c5851e8602aef6e021a6a8503dc0d2ac2dbd..90f57bdab9a20fea73faafba4d4095cfc80ca78a 100644 Binary files a/apps/files_sharing/js/dist/personal-settings.js.map and b/apps/files_sharing/js/dist/personal-settings.js.map differ diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index ff6e8bcae77b3a2c433e75d25a11eacb8e56e4aa..ee944a76258944da69fb576d4b4a704e500f0e94 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -29,7 +29,10 @@ <div v-tooltip.auto="tooltip" class="sharing-entry__desc"> <h5>{{ title }}</h5> </div> - <Actions menu-align="right" class="sharing-entry__actions"> + <Actions + menu-align="right" + class="sharing-entry__actions" + @close="onMenuClose"> <template v-if="share.canEdit"> <!-- edit permission --> <ActionCheckbox @@ -114,9 +117,10 @@ }" :class="{ error: errors.note}" :disabled="saving" - :value.sync="share.note" + :value="share.newNote || share.note" icon="icon-edit" - @update:value="debounceQueueUpdate('note')" /> + @update:value="onNoteChange" + @submit="onNoteSubmit" /> </template> </template> @@ -303,6 +307,13 @@ export default { this.share.permissions = permissions this.queueUpdate('permissions') }, + + /** + * Save potential changed data on menu close + */ + onMenuClose() { + this.onNoteSubmit() + }, }, } </script> diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index ea0f064a21ddfda4dd7147771b0188109df6d641..45565ab22cbd0cc2f26eb79a2b81d7aaff231856 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -121,7 +121,7 @@ class="sharing-entry__actions" menu-align="right" :open.sync="open" - @close="onPasswordSubmit"> + @close="onMenuClose"> <template v-if="share"> <template v-if="share.canEdit"> <!-- folder --> @@ -252,9 +252,10 @@ :class="{ error: errors.note}" :disabled="saving" :placeholder="t('files_sharing', 'Enter a note for the share recipient')" - :value="share.note" + :value="share.newNote || share.note" icon="icon-edit" - @update:value="onNoteChange" /> + @update:value="onNoteChange" + @submit="onNoteSubmit" /> </template> <!-- external sharing via url (social...) --> @@ -777,6 +778,14 @@ export default { } }, + /** + * Save potential changed data on menu close + */ + onMenuClose() { + this.onPasswordSubmit() + this.onNoteSubmit() + }, + /** * Cancel the share creation * Used in the pending popover diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index 19b2a9a6875ca2eb5e866fc63be94b86c7b2b262..2622edaf5e264907974db229c1fca116938f8b61 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -182,15 +182,26 @@ export default { this.queueUpdate('expireDate') }, + /** + * Note changed, let's save it to a different key + * @param {String} note the share note + */ + onNoteChange(note) { + this.$set(this.share, 'newNote', note.trim()) + }, + /** * When the note change, we trim, save and dispatch * * @param {string} note the note */ - onNoteChange: debounce(function(note) { - this.share.note = note.trim() - this.queueUpdate('note') - }, 500), + onNoteSubmit() { + if (this.share.newNote) { + this.share.note = this.share.newNote + this.$delete(this.share, 'newNote') + this.queueUpdate('note') + } + }, /** * Delete share button handler