Changeset 29183
- Timestamp:
- 07/16/2014 12:09:58 AM (10 years ago)
- Location:
- trunk/src/wp-includes/js/tinymce/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js
r28185 r29183 16 16 17 17 function setState( button, node ) { 18 var parent = editor.dom.getParent( node, 'a' ); 18 var parent = editor.dom.getParent( node, 'a' ), 19 getView = editor.plugins.wpview ? editor.plugins.wpview.getView : function() { return false; }; 19 20 20 button.disabled( ( editor.selection.isCollapsed() && ! parent ) || ( parent && ! parent.href ) );21 button.disabled( ( editor.selection.isCollapsed() && ! parent ) || ( parent && ! parent.href ) || getView( node ) ); 21 22 button.active( parent && parent.href ); 22 23 } -
trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js
r29182 r29183 1 1 /* global tinymce */ 2 2 3 /** 3 4 * WordPress View plugin. … … 22 23 function getParent( node, className ) { 23 24 while ( node && node.parentNode ) { 24 if ( node.className && ( ' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1 ) {25 if ( node.className && ( ' ' + node.className + ' ' ).indexOf( ' ' + className + ' ' ) !== -1 ) { 25 26 return node; 26 27 } … … 564 565 } ); 565 566 566 editor.on( ' nodechange', function( event ) {567 editor.on( 'NodeChange', function( event ) { 567 568 var dom = editor.dom, 568 569 views = editor.dom.select( '.wpview-wrap' ), … … 618 619 }); 619 620 620 editor.on( 'resolvename', function( event ) { 621 editor.on( 'BeforeExecCommand', function( event ) { 622 var cmd = event.command, 623 view; 624 625 if ( cmd === 'undo' || cmd === 'redo' || cmd === 'RemoveFormat' || cmd === 'mceToggleFormat' ) { 626 return; 627 } 628 629 if ( view = getView( editor.selection.getNode() ) ) { 630 handleEnter( view ); 631 } 632 }); 633 634 editor.on( 'ResolveName', function( event ) { 621 635 if ( editor.dom.hasClass( event.target, 'wpview-wrap' ) ) { 622 636 event.name = editor.dom.getAttrib( event.target, 'data-wpview-type' ) || 'wpview';
Note: See TracChangeset
for help on using the changeset viewer.