From e5e40644b7d368fc530751ec9c0b7a5410c51b1c Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 3 Mar 2014 15:53:52 +0000 Subject: [PATCH] TinyMCE: Propagate the dragover event outside the editor so drag-and-drop uploads can catch it. props kovshenin. see #19845. git-svn-id: https://develop.svn.wordpress.org/trunk@27372 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/tinymce/plugins/wordpress/plugin.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js index 359a46964e..15c1abdb65 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -443,6 +443,13 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { editor.dom.bind( editor.getBody(), 'dragstart', function() { _hideButtons(); }); + + editor.dom.bind( editor.getWin(), 'dragover', function(e) { + if ( typeof window.jQuery !== 'undefined' ) { + // Propagate the event to its container for the parent window to catch. + jQuery( editor.getContainer() ).trigger(e); + } + }); }); editor.on( 'BeforeExecCommand', function() {