Set wpActiveEditor as soon as any editor associated button is clicked, including Add Media, switching Text to Visual, etc. Fixes #26747.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2013-12-30 19:17:11 +00:00
parent a16cc19790
commit 0226a93d0a

View File

@ -811,15 +811,28 @@ final class _WP_Editors {
}
}
}
}());
if ( typeof jQuery !== 'undefined' ) {
jQuery('.wp-editor-wrap').on( 'click.wp-editor', function() {
if ( this.id ) {
window.wpActiveEditor = this.id.slice( 3, -5 );
}
});
} else {
for ( qtId in tinyMCEPreInit.qtInit ) {
document.getElementById( 'wp-' + qtId + '-wrap' ).onclick = function() {
window.wpActiveEditor = this.id.slice( 3, -5 );
}
}
}
}());
</script>
<?php
if ( in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true) )
if ( in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) )
self::wp_link_dialog();
if ( in_array('wpfullscreen', self::$plugins, true) || in_array('fullscreen', self::$qt_buttons, true) )
if ( in_array( 'wpfullscreen', self::$plugins, true ) || in_array( 'fullscreen', self::$qt_buttons, true ) )
self::wp_fullscreen_html();
do_action( 'after_wp_tiny_mce', self::$mce_settings );