mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 13:16:31 -05:00
parent
884f352846
commit
60169dce6b
3 changed files with 30 additions and 10 deletions
|
@ -3117,10 +3117,20 @@ proto._onPaste = function ( event ) {
|
||||||
setTimeout( function () {
|
setTimeout( function () {
|
||||||
try {
|
try {
|
||||||
// Get the pasted content and clean
|
// Get the pasted content and clean
|
||||||
var frag = empty( detach( pasteArea ) ),
|
var frag = self._doc.createDocumentFragment(),
|
||||||
first = frag.firstChild,
|
next = pasteArea,
|
||||||
range = self._createRange(
|
first, range;
|
||||||
startContainer, startOffset, endContainer, endOffset );
|
|
||||||
|
// #88: Chrome can apparently split the paste area if certain
|
||||||
|
// content is inserted; gather them all up.
|
||||||
|
while ( pasteArea = next ) {
|
||||||
|
next = pasteArea.nextSibling;
|
||||||
|
frag.appendChild( empty( detach( pasteArea ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
first = frag.firstChild;
|
||||||
|
range = self._createRange(
|
||||||
|
startContainer, startOffset, endContainer, endOffset );
|
||||||
|
|
||||||
// Was anything actually pasted?
|
// Was anything actually pasted?
|
||||||
if ( first ) {
|
if ( first ) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1685,10 +1685,20 @@ proto._onPaste = function ( event ) {
|
||||||
setTimeout( function () {
|
setTimeout( function () {
|
||||||
try {
|
try {
|
||||||
// Get the pasted content and clean
|
// Get the pasted content and clean
|
||||||
var frag = empty( detach( pasteArea ) ),
|
var frag = self._doc.createDocumentFragment(),
|
||||||
first = frag.firstChild,
|
next = pasteArea,
|
||||||
range = self._createRange(
|
first, range;
|
||||||
startContainer, startOffset, endContainer, endOffset );
|
|
||||||
|
// #88: Chrome can apparently split the paste area if certain
|
||||||
|
// content is inserted; gather them all up.
|
||||||
|
while ( pasteArea = next ) {
|
||||||
|
next = pasteArea.nextSibling;
|
||||||
|
frag.appendChild( empty( detach( pasteArea ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
first = frag.firstChild;
|
||||||
|
range = self._createRange(
|
||||||
|
startContainer, startOffset, endContainer, endOffset );
|
||||||
|
|
||||||
// Was anything actually pasted?
|
// Was anything actually pasted?
|
||||||
if ( first ) {
|
if ( first ) {
|
||||||
|
|
Loading…
Reference in a new issue