WordPress.org

Make WordPress Core

Changeset 27694


Ignore:
Timestamp:
03/25/2014 12:15:37 AM (6 years ago)
Author:
azaozz
Message:

TinyMCE: bring back removal of the size-* class when the user soft-resizes an image, see #24409

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

    r27693 r27694  
    669669    editor.on( 'ObjectResized', function( event ) {
    670670        var parent, width,
    671             node = event.target;
     671            node = event.target,
     672            dom = editor.dom;
    672673
    673674        if ( node.nodeName === 'IMG' ) {
    674             if ( parent = editor.dom.getParent( node, '.wp-caption' ) ) {
    675                 width = event.width || editor.dom.getAttrib( node, 'width' );
     675            node.className = node.className.replace( /\bsize-[^ ]+/, '' );
     676
     677            if ( parent = dom.getParent( node, '.wp-caption' ) ) {
     678                width = event.width || dom.getAttrib( node, 'width' );
    676679
    677680                if ( width ) {
     
    682685                    }
    683686
    684                     editor.dom.setStyle( parent, 'width', width + 'px' );
     687                    dom.setStyle( parent, 'width', width + 'px' );
    685688                }
    686689            }
Note: See TracChangeset for help on using the changeset viewer.