mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Support pasting images in Edge
This commit is contained in:
parent
50fb7c7c53
commit
070f2e52a3
3 changed files with 32 additions and 6 deletions
|
@ -2278,8 +2278,21 @@ var onPaste = function ( event ) {
|
|||
// ---------------------------------
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html
|
||||
|
||||
// Edge only provides access to plain text as of 2016-03-11.
|
||||
if ( !isEdge && items ) {
|
||||
// Edge only provides access to plain text as of 2016-03-11 and gives no
|
||||
// indication there should be an HTML part. However, it does support access
|
||||
// to image data, so check if this is present and use if so.
|
||||
if ( isEdge && items ) {
|
||||
l = items.length;
|
||||
while ( l-- ) {
|
||||
if ( !choosePlain && /^image\/.*/.test( items[l].type ) ) {
|
||||
hasImage = true;
|
||||
}
|
||||
}
|
||||
if ( !hasImage ) {
|
||||
items = null;
|
||||
}
|
||||
}
|
||||
if ( items ) {
|
||||
event.preventDefault();
|
||||
l = items.length;
|
||||
while ( l-- ) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -149,8 +149,21 @@ var onPaste = function ( event ) {
|
|||
// ---------------------------------
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html
|
||||
|
||||
// Edge only provides access to plain text as of 2016-03-11.
|
||||
if ( !isEdge && items ) {
|
||||
// Edge only provides access to plain text as of 2016-03-11 and gives no
|
||||
// indication there should be an HTML part. However, it does support access
|
||||
// to image data, so check if this is present and use if so.
|
||||
if ( isEdge && items ) {
|
||||
l = items.length;
|
||||
while ( l-- ) {
|
||||
if ( !choosePlain && /^image\/.*/.test( items[l].type ) ) {
|
||||
hasImage = true;
|
||||
}
|
||||
}
|
||||
if ( !hasImage ) {
|
||||
items = null;
|
||||
}
|
||||
}
|
||||
if ( items ) {
|
||||
event.preventDefault();
|
||||
l = items.length;
|
||||
while ( l-- ) {
|
||||
|
|
Loading…
Reference in a new issue