summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-04-21 13:57:26 +0000
committerDouwe Maan <douwe@gitlab.com>2017-04-21 13:57:26 +0000
commitf97d818cd7ed707cf0d1d6789998b11b5430fbc7 (patch)
tree4087c482b9b69ef4c5cffa6d285e015dba4a497f
parent3f4b5a80fb3948f00069a0bc2a713e25e11fbfff (diff)
parentae2e0b691548d3b4dcb6dc29ce21482a3d616d72 (diff)
downloadgitlab-ce-f97d818cd7ed707cf0d1d6789998b11b5430fbc7.tar.gz
Merge branch '31193-ff-copy' into 'master'
fix inline diff copying in firefox Closes #31193 See merge request !10838
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js5
-rw-r--r--changelogs/unreleased/31193-ff-copy.yml4
2 files changed, 8 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js
index 01c4b9821d3..8058672eaa9 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js
+++ b/app/assets/javascripts/lib/utils/common_utils.js
@@ -169,7 +169,10 @@
w.gl.utils.getSelectedFragment = () => {
const selection = window.getSelection();
if (selection.rangeCount === 0) return null;
- const documentFragment = selection.getRangeAt(0).cloneContents();
+ const documentFragment = document.createDocumentFragment();
+ for (let i = 0; i < selection.rangeCount; i += 1) {
+ documentFragment.appendChild(selection.getRangeAt(i).cloneContents());
+ }
if (documentFragment.textContent.length === 0) return null;
return documentFragment;
diff --git a/changelogs/unreleased/31193-ff-copy.yml b/changelogs/unreleased/31193-ff-copy.yml
new file mode 100644
index 00000000000..4d44d83d458
--- /dev/null
+++ b/changelogs/unreleased/31193-ff-copy.yml
@@ -0,0 +1,4 @@
+---
+title: fix inline diff copy in firefox
+merge_request:
+author: