Skip to content

Commit

Permalink
Merge branch 't/12421' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Sep 30, 2014
2 parents 80b01f5 + 4f2fb22 commit 039a91a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion plugins/clipboard/plugin.js
Expand Up @@ -1321,7 +1321,17 @@
// We need to call preventDefault on dragover because otherwise if
// we drop image it will overwrite document.
editable.attachListener( dropTarget, 'dragover', function( evt ) {
evt.data.preventDefault();

// If we do not prevent default dragover on IE the file path
// will be loaded and we will lose content. On the other hand
// if we prevent it the cursor will not we shown, so we prevent
// dragover only on IE, on versions which support file API and only
// if the event contains files.
if ( CKEDITOR.env.ie &&
CKEDITOR.plugins.clipboard.isFileApiSupported &&
evt.data.$.dataTransfer.types.contains( 'Files' ) ) {
evt.data.preventDefault();
}
} );

editable.attachListener( dropTarget, 'drop', function( evt ) {
Expand Down Expand Up @@ -1479,6 +1489,15 @@
*/
isCustomDataTypesSupported: !CKEDITOR.env.ie,

/**
* True if the environment supports File API.
*
* @since 4.5
* @readonly
* @property {Boolean}
*/
isFileApiSupported: !CKEDITOR.env.ie || CKEDITOR.env.version > 9,

/**
* Returns the element should be used as target for the drop event.
*
Expand Down

0 comments on commit 039a91a

Please sign in to comment.