fix inline diff copying in firefox

This commit is contained in:
Simon Knox 2017-04-21 07:40:48 +10:00
parent bbd83376d6
commit ae2e0b6915
2 changed files with 8 additions and 1 deletions

View File

@ -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;

View File

@ -0,0 +1,4 @@
---
title: fix inline diff copy in firefox
merge_request:
author: