mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-18 04:32:28 -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
|
// https://html.spec.whatwg.org/multipage/interaction.html
|
||||||
|
|
||||||
// Edge only provides access to plain text as of 2016-03-11.
|
// Edge only provides access to plain text as of 2016-03-11 and gives no
|
||||||
if ( !isEdge && items ) {
|
// 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();
|
event.preventDefault();
|
||||||
l = items.length;
|
l = items.length;
|
||||||
while ( l-- ) {
|
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
|
// https://html.spec.whatwg.org/multipage/interaction.html
|
||||||
|
|
||||||
// Edge only provides access to plain text as of 2016-03-11.
|
// Edge only provides access to plain text as of 2016-03-11 and gives no
|
||||||
if ( !isEdge && items ) {
|
// 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();
|
event.preventDefault();
|
||||||
l = items.length;
|
l = items.length;
|
||||||
while ( l-- ) {
|
while ( l-- ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue