Set wpActiveEditor to the id of the first instance on init, props kovshenin, fixes #27210.

git-svn-id: https://develop.svn.wordpress.org/trunk@27270 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-02-25 19:30:46 +00:00
parent 7a21b05378
commit 58fe64750d
1 changed files with 19 additions and 7 deletions

View File

@ -800,12 +800,6 @@ final class _WP_Editors {
var init, edId, qtId, firstInit, override,
loadMCE = typeof getUserSetting !== 'undefined' ? getUserSetting( 'editor' ) === 'tinymce' : true;
if ( typeof quicktags !== 'undefined' ) {
for ( qtId in tinyMCEPreInit.qtInit ) {
try { quicktags( tinyMCEPreInit.qtInit[qtId] ); } catch(e){};
}
}
if ( typeof tinymce !== 'undefined' ) {
for ( edId in tinyMCEPreInit.mceInit ) {
if ( firstInit ) {
@ -818,11 +812,29 @@ final class _WP_Editors {
override = override || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId );
if ( ( loadMCE || override ) && ! init.wp_skip_init ) {
try { tinymce.init( init ); } catch(e){}
try {
tinymce.init( init );
if ( ! window.wpActiveEditor ) {
window.wpActiveEditor = edId;
}
} catch(e){}
}
}
}
if ( typeof quicktags !== 'undefined' ) {
for ( qtId in tinyMCEPreInit.qtInit ) {
try {
quicktags( tinyMCEPreInit.qtInit[qtId] );
if ( ! window.wpActiveEditor ) {
window.wpActiveEditor = qtId;
}
} catch(e){};
}
}
if ( typeof jQuery !== 'undefined' ) {
jQuery('.wp-editor-wrap').on( 'click.wp-editor', function() {
if ( this.id ) {