mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 05:00:13 -05:00
Fix dummy paste area should be removed after paste completes
This commit is contained in:
parent
7fc3ab55c3
commit
def56193d4
3 changed files with 7 additions and 1 deletions
|
@ -1990,6 +1990,8 @@ var onPaste = function ( event ) {
|
||||||
// paste event.
|
// paste event.
|
||||||
setTimeout( function () {
|
setTimeout( function () {
|
||||||
try {
|
try {
|
||||||
|
// IE sometimes fires the beforepaste event twice; make sure it is
|
||||||
|
// not run again before our after paste function is called.
|
||||||
self._awaitingPaste = false;
|
self._awaitingPaste = false;
|
||||||
|
|
||||||
// Get the pasted content and clean
|
// Get the pasted content and clean
|
||||||
|
@ -2001,6 +2003,7 @@ var onPaste = function ( event ) {
|
||||||
// content is inserted; gather them all up.
|
// content is inserted; gather them all up.
|
||||||
while ( pasteArea = next ) {
|
while ( pasteArea = next ) {
|
||||||
next = pasteArea.nextSibling;
|
next = pasteArea.nextSibling;
|
||||||
|
detach( pasteArea );
|
||||||
// Safari and IE like putting extra divs around things.
|
// Safari and IE like putting extra divs around things.
|
||||||
first = pasteArea.firstChild;
|
first = pasteArea.firstChild;
|
||||||
if ( first && first === pasteArea.lastChild &&
|
if ( first && first === pasteArea.lastChild &&
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -121,6 +121,8 @@ var onPaste = function ( event ) {
|
||||||
// paste event.
|
// paste event.
|
||||||
setTimeout( function () {
|
setTimeout( function () {
|
||||||
try {
|
try {
|
||||||
|
// IE sometimes fires the beforepaste event twice; make sure it is
|
||||||
|
// not run again before our after paste function is called.
|
||||||
self._awaitingPaste = false;
|
self._awaitingPaste = false;
|
||||||
|
|
||||||
// Get the pasted content and clean
|
// Get the pasted content and clean
|
||||||
|
@ -132,6 +134,7 @@ var onPaste = function ( event ) {
|
||||||
// content is inserted; gather them all up.
|
// content is inserted; gather them all up.
|
||||||
while ( pasteArea = next ) {
|
while ( pasteArea = next ) {
|
||||||
next = pasteArea.nextSibling;
|
next = pasteArea.nextSibling;
|
||||||
|
detach( pasteArea );
|
||||||
// Safari and IE like putting extra divs around things.
|
// Safari and IE like putting extra divs around things.
|
||||||
first = pasteArea.firstChild;
|
first = pasteArea.firstChild;
|
||||||
if ( first && first === pasteArea.lastChild &&
|
if ( first && first === pasteArea.lastChild &&
|
||||||
|
|
Loading…
Reference in a new issue