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:
parent
7a21b05378
commit
58fe64750d
@ -800,12 +800,6 @@ final class _WP_Editors {
|
|||||||
var init, edId, qtId, firstInit, override,
|
var init, edId, qtId, firstInit, override,
|
||||||
loadMCE = typeof getUserSetting !== 'undefined' ? getUserSetting( 'editor' ) === 'tinymce' : true;
|
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' ) {
|
if ( typeof tinymce !== 'undefined' ) {
|
||||||
for ( edId in tinyMCEPreInit.mceInit ) {
|
for ( edId in tinyMCEPreInit.mceInit ) {
|
||||||
if ( firstInit ) {
|
if ( firstInit ) {
|
||||||
@ -818,11 +812,29 @@ final class _WP_Editors {
|
|||||||
override = override || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId );
|
override = override || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId );
|
||||||
|
|
||||||
if ( ( loadMCE || override ) && ! init.wp_skip_init ) {
|
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' ) {
|
if ( typeof jQuery !== 'undefined' ) {
|
||||||
jQuery('.wp-editor-wrap').on( 'click.wp-editor', function() {
|
jQuery('.wp-editor-wrap').on( 'click.wp-editor', function() {
|
||||||
if ( this.id ) {
|
if ( this.id ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user