From bccdaa137d0598695f51dd3a3ecf65e2d82532d6 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 27 Nov 2012 19:24:56 +0000 Subject: [PATCH] Media in Internet Explorer: Properly insert attachments into the editor at the location of the cursor. props azaozz. fixes #22446. git-svn-id: https://develop.svn.wordpress.org/trunk@22877 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/media-editor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/js/media-editor.js b/wp-includes/js/media-editor.js index 19be0db3d5..315940a28a 100644 --- a/wp-includes/js/media-editor.js +++ b/wp-includes/js/media-editor.js @@ -501,6 +501,10 @@ // Last but not least, fall back to the empty string. id = id || ''; + // Save a bookmark of the caret position, needed for IE + if ( typeof tinymce !== 'undefined' && tinymce.activeEditor && tinymce.isIE && ! tinymce.activeEditor.isHidden() ) + tinymce.activeEditor.windowManager.insertimagebookmark = tinymce.activeEditor.selection.getBookmark(); + workflow = wp.media.editor.get( id ); // If the workflow exists, open it.