From 721c065a4478ed3b68382d33283c36fb9a5e1883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Tue, 14 Mar 2023 13:55:47 +0100 Subject: [PATCH] fix editing in modal-jot and add also timeout before removing images from dropzone --- view/theme/frio/js/modal.js | 8 +++++--- view/theme/frio/templates/jot.tpl | 14 ++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/view/theme/frio/js/modal.js b/view/theme/frio/js/modal.js index 876fe90a8..a20862e75 100644 --- a/view/theme/frio/js/modal.js +++ b/view/theme/frio/js/modal.js @@ -293,7 +293,7 @@ function editpost(url) { // To make dropzone fileupload work on editing a comment, we need to // attach a new dropzone to modal - dropzoneJotEdit = new Dropzone( '#dropzone-jot', { + dropzoneJotEdit = new Dropzone( '#jot-text-wrap', { paramName: "userfile", // The name that will be used to transfer the file maxFilesize: getMBytes('{{$max_imagesize}}'), // MB url: "/media/photo/upload?response=url&album=", @@ -317,13 +317,15 @@ function editpost(url) { // Image can be seen in posting-preview // We need preview to get optical feedback about upload-progress. // you see success, when the bb-code link for image is inserted - this.removeFile(file); + setTimeout(function(){ + dropzoneJotEdit.removeFile(file); + },5000); }); }, }); // Enables Copy&Paste for this dropzone - $('#dropzone-jot').on('paste', function(event){ + $('#jot-text-wrap').on('paste', function(event){ const items = (event.clipboardData || event.originalEvent.clipboardData).items; items.forEach((item) => { if (item.kind === 'file') { diff --git a/view/theme/frio/templates/jot.tpl b/view/theme/frio/templates/jot.tpl index 7ad44ff9a..1ffe7dd3c 100644 --- a/view/theme/frio/templates/jot.tpl +++ b/view/theme/frio/templates/jot.tpl @@ -99,11 +99,11 @@ {{/if}} {{* The jot text field in which the post text is inserted *}} -
-
+ +
-
+