TinyMCE: re-enable soft resizing of images inside the editor. See #24067.

git-svn-id: https://develop.svn.wordpress.org/trunk@26934 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-01-13 01:12:20 +00:00
parent a6742e996a
commit 1e3460cea3
2 changed files with 9 additions and 1 deletions

View File

@ -312,7 +312,6 @@ final class _WP_Editors {
'entities' => '38,amp,60,lt,62,gt',
'entity_encoding' => 'raw',
'menubar' => false,
'object_resizing' => false,
'keep_styles' => false,
'paste_remove_styles' => true,

View File

@ -331,6 +331,15 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
});
});
editor.on( 'ObjectResized', function( event ) {
var parent,
node = event.target;
if ( node.nodeName === 'IMG' && ( parent = editor.dom.getParent( node, '.wp-caption' ) ) ) {
editor.dom.setStyle( parent, 'width', 10 + event.width + 'px' );
}
});
editor.on( 'BeforeExecCommand', function( e ) {
var node, p, DL, align,
cmd = e.command,