WordPress.org

Make WordPress Core

Changeset 28232


Ignore:
Timestamp:
05/01/2014 04:42:09 AM (6 years ago)
Author:
nacin
Message:

TinyMCE: fix the "active" state of the Link button when an image wrapped in a link is selected.

Merges [28185] to the 3.9 branch.

props azaozz.
fixes #27847.

Location:
branches/3.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.9

  • branches/3.9/src/wp-includes/js/tinymce/plugins/wplink/plugin.js

    r27934 r28232  
    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.