Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2017-02-22 22:47:25 +0300
committerAlfredo Sumaran <alfredo@gitlab.com>2017-02-22 22:47:25 +0300
commitfb81291ee00a18e12ff290ae8b4caa63bb90e556 (patch)
tree7a9fdbb0848020913d80873d137f92c80762558f /app/assets
parent61e2a3eb15b2b7661523214c86c0f4f3d5ecc525 (diff)
parent9f322f2b3866833af1bca7ecd3624428d968b017 (diff)
Merge branch 'newline-after-file-attachment-notes' into 'master'
Added double newline after file upload markdown insert Closes #28511 See merge request !9430
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/dropzone_input.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js
index 64a7a9eaf37..646f836aff0 100644
--- a/app/assets/javascripts/dropzone_input.js
+++ b/app/assets/javascripts/dropzone_input.js
@@ -126,13 +126,14 @@ require('./preview_markdown');
};
pasteText = function(text) {
var afterSelection, beforeSelection, caretEnd, caretStart, textEnd;
+ var formattedText = text + "\n\n";
caretStart = $(child)[0].selectionStart;
caretEnd = $(child)[0].selectionEnd;
textEnd = $(child).val().length;
beforeSelection = $(child).val().substring(0, caretStart);
afterSelection = $(child).val().substring(caretEnd, textEnd);
- $(child).val(beforeSelection + text + afterSelection);
- child.get(0).setSelectionRange(caretStart + text.length, caretEnd + text.length);
+ $(child).val(beforeSelection + formattedText + afterSelection);
+ child.get(0).setSelectionRange(caretStart + formattedText.length, caretEnd + formattedText.length);
return form_textarea.trigger("input");
};
getFilename = function(e) {