mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-02 09:07:59 +02:00
TinyMCE: set the proper caption width when clicking image resize handle on image with caption. Props gcorne, fixes #27009, see #24067.
Built from https://develop.svn.wordpress.org/trunk@27098 git-svn-id: http://core.svn.wordpress.org/trunk@26969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
228fc639b9
commit
c4f8dede57
@ -495,11 +495,16 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
});
|
||||
|
||||
editor.on( 'ObjectResized', function( event ) {
|
||||
var parent,
|
||||
var parent, width,
|
||||
node = event.target;
|
||||
|
||||
if ( node.nodeName === 'IMG' && ( parent = editor.dom.getParent( node, '.wp-caption' ) ) ) {
|
||||
editor.dom.setStyle( parent, 'width', 10 + event.width + 'px' );
|
||||
width = event.width || editor.dom.getAttrib( node, 'width' );
|
||||
|
||||
if ( width ) {
|
||||
width = parseInt( width, 10 ) + 10;
|
||||
editor.dom.setStyle( parent, 'width', width + 'px' );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in New Issue
Block a user