TinyMCE: add/remove the 'alignnone' class when aligning images without captions. See #24067.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-01-14 05:52:09 +00:00
parent 88959be27d
commit 1ddc17780a
4 changed files with 12 additions and 3 deletions

View File

@ -364,7 +364,6 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
}
}
} else if ( cmd === 'JustifyLeft' || cmd === 'JustifyRight' || cmd === 'JustifyCenter' ) {
// When inside an image caption, set the align* class on dt.wp-caption
node = editor.selection.getNode();
align = cmd.substr(7).toLowerCase();
align = 'align' + align;
@ -376,6 +375,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
}
if ( DL ) {
// When inside an image caption, set the align* class on dl.wp-caption
if ( dom.hasClass( DL, align ) ) {
dom.removeClass( DL, align );
dom.addClass( DL, 'alignnone' );
@ -386,6 +386,15 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
return false;
}
if ( node.nodeName === 'IMG' ) {
if ( dom.hasClass( node, align ) ) {
// The align class is being removed
dom.addClass( node, 'alignnone' );
} else {
dom.removeClass( node, 'alignnone' );
}
}
}
});

File diff suppressed because one or more lines are too long

View File

@ -18,7 +18,7 @@ $wp_db_version = 26691;
*
* @global string $tinymce_version
*/
$tinymce_version = '4012-20140109';
$tinymce_version = '4012-20140113';
/**
* Holds the required PHP version