TinyMCE: fix alignment buttons when used on image with caption. Remove old/unneeded code. Fixes #28705.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-08-04 00:52:17 +00:00
parent 42c8135fac
commit 666fec5144
4 changed files with 10 additions and 19 deletions

View File

@ -794,29 +794,15 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
dom.insertAfter( p, node );
editor.selection.setCursorLocation( p, 0 );
editor.nodeChanged();
if ( tinymce.Env.ie > 8 ) {
setTimeout( function() {
editor.selection.setCursorLocation( p, 0 );
editor.selection.setContent( event.value );
}, 500 );
return false;
}
}
} else if ( cmd === 'JustifyLeft' || cmd === 'JustifyRight' || cmd === 'JustifyCenter' ) {
node = editor.selection.getNode();
align = cmd.substr(7).toLowerCase();
align = 'align' + align;
align = 'align' + align,
DL = dom.getParent( node, 'dl.wp-caption' );
removeToolbar();
if ( dom.is( node, 'dl.wp-caption' ) ) {
DL = node;
} else {
DL = dom.getParent( node, 'dl.wp-caption' );
}
if ( DL ) {
// When inside an image caption, set the align* class on dl.wp-caption
if ( dom.hasClass( DL, align ) ) {
@ -827,7 +813,12 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
dom.addClass( DL, align );
}
return false;
if ( node.nodeName === 'IMG' ) {
// Re-select the image to update resize handles, etc.
editor.nodeChanged();
}
event.preventDefault();
}
if ( node.nodeName === 'IMG' ) {

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.0-beta2-20140803';
$wp_version = '4.0-beta2-20140804';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.