From 5040bd9a1a69d0956a67f15590a4acfeb29969f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Fri, 17 Mar 2023 17:05:18 +0100 Subject: [PATCH] change response-handling (code-review) --- view/js/dropzone-factory.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/view/js/dropzone-factory.js b/view/js/dropzone-factory.js index 1b2a293374..c2246dfa20 100644 --- a/view/js/dropzone-factory.js +++ b/view/js/dropzone-factory.js @@ -13,13 +13,12 @@ var DzFactory = function () { init: function() { this.on('success', function(file, serverResponse) { const targetTextarea = document.getElementById(textareaElementId); - const bbcodeString = serverResponse; if (targetTextarea.setRangeText) { //if setRangeText function is supported by current browser - targetTextarea.setRangeText(' ' + $.trim(bbcodeString) + ' '); + targetTextarea.setRangeText(' ' + $.trim(serverResponse) + ' '); } else { targetTextarea.focus(); - document.execCommand('insertText', false /*no UI*/, '\n' + $.trim(bbcodeString) + '\n'); + document.execCommand('insertText', false /*no UI*/, '\n' + $.trim(serverResponse) + '\n'); } }); this.on('complete', function(file) {