TinyMCE: bring back removal of the size-* class when the user soft-resizes an image, see #24409
Built from https://develop.svn.wordpress.org/trunk@27694 git-svn-id: http://core.svn.wordpress.org/trunk@27533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d85ac5b841
commit
a3d08715ab
|
@ -668,11 +668,14 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
|
||||
editor.on( 'ObjectResized', function( event ) {
|
||||
var parent, width,
|
||||
node = event.target;
|
||||
node = event.target,
|
||||
dom = editor.dom;
|
||||
|
||||
if ( node.nodeName === 'IMG' ) {
|
||||
if ( parent = editor.dom.getParent( node, '.wp-caption' ) ) {
|
||||
width = event.width || editor.dom.getAttrib( node, 'width' );
|
||||
node.className = node.className.replace( /\bsize-[^ ]+/, '' );
|
||||
|
||||
if ( parent = dom.getParent( node, '.wp-caption' ) ) {
|
||||
width = event.width || dom.getAttrib( node, 'width' );
|
||||
|
||||
if ( width ) {
|
||||
width = parseInt( width, 10 );
|
||||
|
@ -681,7 +684,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
width += 10;
|
||||
}
|
||||
|
||||
editor.dom.setStyle( parent, 'width', width + 'px' );
|
||||
dom.setStyle( parent, 'width', width + 'px' );
|
||||
}
|
||||
}
|
||||
// refresh toolbar
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in New Issue