mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
TinyMCE: add/remove the 'alignnone' class when aligning images without captions. See #24067.
git-svn-id: https://develop.svn.wordpress.org/trunk@26942 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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' );
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user