WordPress.org

Make WordPress Core

Changeset 33141


Ignore:
Timestamp:
07/09/2015 12:24:34 AM (6 years ago)
Author:
azaozz
Message:

TinyMCE: when deleting an image, ensure the wrapping link (if any) is deleted too. Fixes the erroneous showing of the link toolbar after deleting an image. Also small readability fix.
See #32604.

Location:
trunk/src/wp-includes/js/tinymce/plugins
Files:
2 edited

Legend:

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

    r33127 r33141  
    821821
    822822                    timeout = setTimeout( function() {
    823                         activeToolbar && activeToolbar.show && activeToolbar.show();
     823                        if ( activeToolbar && typeof activeToolbar.show === 'function' ) {
     824                            activeToolbar.show();
     825                        }
    824826                    }, 250 );
    825827                }
  • trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

    r32592 r33141  
    526526
    527527    function removeImage( node ) {
    528         var wrap;
    529 
    530         if ( node.nodeName === 'DIV' && editor.dom.hasClass( node, 'mceTemp' ) ) {
    531             wrap = node;
    532         } else if ( node.nodeName === 'IMG' || node.nodeName === 'DT' || node.nodeName === 'A' ) {
    533             wrap = editor.dom.getParent( node, 'div.mceTemp' );
     528        var wrap = editor.dom.getParent( node, 'div.mceTemp' );
     529
     530        if ( ! wrap && node.nodeName === 'IMG' ) {
     531            wrap = editor.dom.getParent( node, 'a' );
    534532        }
    535533
Note: See TracChangeset for help on using the changeset viewer.