Ticket #22446: 22446-ie789-insert-3.patch
File 22446-ie789-insert-3.patch, 1.5 KB (added by , 12 years ago) |
---|
-
wp-includes/js/media-editor.js
509 509 }, 510 510 511 511 open: function( id ) { 512 var workflow ;512 var workflow, editor; 513 513 514 514 // If an empty `id` is provided, default to `wpActiveEditor`. 515 515 id = id || wpActiveEditor; 516 516 517 // If that doesn't work, fall back to `tinymce.activeEditor`. 518 if ( ! id && typeof tinymce !== 'undefined' && tinymce.activeEditor ) 519 id = id || tinymce.activeEditor.id; 517 if ( typeof tinymce !== 'undefined' && tinymce.activeEditor ) { 518 // If that doesn't work, fall back to `tinymce.activeEditor`. 519 if ( ! id ) { 520 editor = tinymce.activeEditor; 521 id = id || editor.id; 522 } else { 523 editor = tinymce.get( id ); 524 } 520 525 526 // Save a bookmark of the caret position, needed for IE 527 if ( tinymce.isIE && editor && ! editor.isHidden() ) 528 editor.windowManager.insertimagebookmark = editor.selection.getBookmark(); 529 } 530 521 531 // Last but not least, fall back to the empty string. 522 532 id = id || ''; 523 533 524 // Save a bookmark of the caret position, needed for IE525 if ( typeof tinymce !== 'undefined' && tinymce.activeEditor && tinymce.isIE && ! tinymce.activeEditor.isHidden() )526 tinymce.activeEditor.windowManager.insertimagebookmark = tinymce.activeEditor.selection.getBookmark();527 528 534 workflow = wp.media.editor.get( id ); 529 535 530 536 // If the workflow exists, open it.