mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
[fix] Fix drag and drop tests for IE
This commit is contained in:
parent
a6436ac8d2
commit
02bd4a31af
1 changed files with 10 additions and 2 deletions
|
@ -154,7 +154,15 @@ describe('drag and drop', function() {
|
||||||
var $target = getLine(targetLineNumber);
|
var $target = getLine(targetLineNumber);
|
||||||
$target.sendkeys('{selectall}{rightarrow}{leftarrow}');
|
$target.sendkeys('{selectall}{rightarrow}{leftarrow}');
|
||||||
|
|
||||||
// insert content
|
// Insert content.
|
||||||
innerDocument.execCommand('insertHTML', false, draggedHtml);
|
// Based on http://stackoverflow.com/a/6691294, to be IE-compatible
|
||||||
|
var range = innerDocument.getSelection().getRangeAt(0);
|
||||||
|
var frag = innerDocument.createDocumentFragment();
|
||||||
|
var el = innerDocument.createElement('div');
|
||||||
|
el.innerHTML = draggedHtml;
|
||||||
|
while (el.firstChild) {
|
||||||
|
frag.appendChild(el.firstChild);
|
||||||
|
}
|
||||||
|
range.insertNode(frag);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue