WordPress.org

Make WordPress Core

Ticket #27009: 27009-01.patch

File 27009-01.patch, 702 bytes (added by gcorne, 8 years ago)
  • src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

    diff --git src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
    index f3e66e6..8db5d37 100644
    tinymce.PluginManager.add( 'wpeditimage', function( editor ) { 
    498498        var parent,
    499499                        node = event.target;
    500500
    501                 if ( node.nodeName === 'IMG' && ( parent = editor.dom.getParent( node, '.wp-caption' ) ) ) {
     501                if ( node.nodeName === 'IMG' && ( parent = editor.dom.getParent( node, '.wp-caption' ) && event.width > 0 ) ) {
    502502                        editor.dom.setStyle( parent, 'width', 10 + event.width + 'px' );
    503503                }
    504504    });