Make WordPress Core

Changeset 28185


Ignore:
Timestamp:
04/22/2014 09:10:14 PM (11 years ago)
Author:
azaozz
Message:

TinyMCE: fix the "active" state of the Link button when an image wrapped in a link is selected, see #27847, for trunk.

File:
1 edited

Legend:

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

    r27934 r28185  
    1616
    1717    function setState( button, node ) {
    18         button.disabled( editor.selection.isCollapsed() && node.nodeName !== 'A' );
    19         button.active( node.nodeName === 'A' && ! node.name );
     18        var parent = editor.dom.getParent( node, 'a' );
     19
     20        button.disabled( ( editor.selection.isCollapsed() && ! parent ) || ( parent && ! parent.href ) );
     21        button.active( parent && parent.href );
    2022    }
    2123
Note: See TracChangeset for help on using the changeset viewer.