Make WordPress Core

Changeset 29370


Ignore:
Timestamp:
08/04/2014 12:51:19 AM (11 years ago)
Author:
azaozz
Message:

TinyMCE: fix alignment buttons when used on image with caption. Remove old/unneeded code. Fixes #28705.

File:
1 edited

Legend:

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

    r28615 r29370  
    795795                editor.selection.setCursorLocation( p, 0 );
    796796                editor.nodeChanged();
    797 
    798                 if ( tinymce.Env.ie > 8 ) {
    799                     setTimeout( function() {
    800                         editor.selection.setCursorLocation( p, 0 );
    801                         editor.selection.setContent( event.value );
    802                     }, 500 );
    803 
    804                     return false;
    805                 }
    806797            }
    807798        } else if ( cmd === 'JustifyLeft' || cmd === 'JustifyRight' || cmd === 'JustifyCenter' ) {
    808799            node = editor.selection.getNode();
    809800            align = cmd.substr(7).toLowerCase();
    810             align = 'align' + align;
     801            align = 'align' + align,
     802            DL = dom.getParent( node, 'dl.wp-caption' );
    811803
    812804            removeToolbar();
    813 
    814             if ( dom.is( node, 'dl.wp-caption' ) ) {
    815                 DL = node;
    816             } else {
    817                 DL = dom.getParent( node, 'dl.wp-caption' );
    818             }
    819805
    820806            if ( DL ) {
     
    828814                }
    829815
    830                 return false;
     816                if ( node.nodeName === 'IMG' ) {
     817                    // Re-select the image to update resize handles, etc.
     818                    editor.nodeChanged();
     819                }
     820
     821                event.preventDefault();
    831822            }
    832823
Note: See TracChangeset for help on using the changeset viewer.