Changeset 29184
- Timestamp:
- 07/16/2014 02:18:18 AM (11 years ago)
- Location:
- trunk/src/wp-includes/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r29179 r29184 1 /* global tinymce , MediaElementPlayer, WPPlaylistView*/1 /* global tinymce */ 2 2 /** 3 3 * Note: this API is "experimental" meaning that it will probably change -
trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js
r29183 r29184 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 ) { … … 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 … … 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; 627 } 628 629 if ( view = getView( editor.selection.getNode() ) ) { 625 if ( node && ( node.className === 'wpview-selection-before' || node.className === 'wpview-selection-after' ) && ( view = getView( node ) ) ) { 630 626 handleEnter( view ); 627 execCommandView = view; 628 } 629 }); 630 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 });
Note: See TracChangeset
for help on using the changeset viewer.