Changeset 22905
- Timestamp:
- 11/28/2012 09:45:10 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-editor.js
r22895 r22905 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 } 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 } 520 530 521 531 // Last but not least, fall back to the empty string. 522 532 id = id || ''; 523 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 533 528 534 workflow = wp.media.editor.get( id );
Note: See TracChangeset
for help on using the changeset viewer.