Ticket #28595: 28595.18.patch
File 28595.18.patch, 2.4 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/mce-view.js
1 /* global tinymce , MediaElementPlayer, WPPlaylistView*/1 /* global tinymce */ 2 2 /** 3 3 * Note: this API is "experimental" meaning that it will probably change 4 4 * in the next few releases based on feedback from 3.9.0. -
src/wp-includes/js/tinymce/plugins/wpview/plugin.js
10 10 TreeWalker = tinymce.dom.TreeWalker, 11 11 toRemove = false, 12 12 firstFocus = true, 13 cursorInterval, lastKeyDownNode, setViewCursorTries, focus ;13 cursorInterval, lastKeyDownNode, setViewCursorTries, focus, execCommandView; 14 14 15 15 function getView( node ) { 16 16 return getParent( node, 'wpview-wrap' ); … … 581 581 582 582 if ( focus ) { 583 583 if ( view ) { 584 if ( className === 'wpview-selection-before' || className === 'wpview-selection-after'&& editor.selection.isCollapsed() ) {584 if ( ( className === 'wpview-selection-before' || className === 'wpview-selection-after' ) && editor.selection.isCollapsed() ) { 585 585 setViewCursorTries = 0; 586 586 587 587 deselect(); … … 618 618 } 619 619 }); 620 620 621 editor.on( 'BeforeExecCommand', function( event) {622 var cmd = event.command,621 editor.on( 'BeforeExecCommand', function() { 622 var node = editor.selection.getNode(), 623 623 view; 624 624 625 if ( cmd === 'undo' || cmd === 'redo' || cmd === 'RemoveFormat' || cmd === 'mceToggleFormat' ) { 626 return; 625 if ( node && ( node.className === 'wpview-selection-before' || node.className === 'wpview-selection-after' ) && ( view = getView( node ) ) ) { 626 handleEnter( view ); 627 execCommandView = view; 627 628 } 629 }); 628 630 629 if ( view = getView( editor.selection.getNode() ) ) { 630 handleEnter( view ); 631 editor.on( 'ExecCommand', function() { 632 var toSelect, node; 633 634 if ( selected ) { 635 toSelect = selected; 636 deselect(); 637 select( toSelect ); 638 } 639 640 if ( execCommandView ) { 641 node = execCommandView.nextSibling; 642 643 if ( node && node.nodeName === 'P' && editor.dom.isEmpty( node ) ) { 644 editor.dom.remove( node ); 645 setViewCursor( false, execCommandView ); 646 } 647 648 execCommandView = false; 631 649 } 632 650 }); 633 651