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

Built from https://develop.svn.wordpress.org/trunk@27270


git-svn-id: http://core.svn.wordpress.org/trunk@27126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-02-25 19:31:14 +00:00
parent c4cd842c29
commit 65fac9e55a
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 ) {