Ticket #5845: 5845.patch
File 5845.patch, 1.4 KB (added by , 14 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
14 14 var nonExitableElementNames = { table:1,pre:1 }; 15 15 16 16 // Matching an empty paragraph at the end of document. 17 var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center )[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi;17 var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center|li)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi; 18 18 19 19 function onInsertHtml( evt ) 20 20 { … … 445 445 } ); 446 446 } 447 447 448 if ( CKEDITOR.env.gecko ) 449 { 450 domDocument.on( 'mouseup', function( ev ) 451 { 452 if ( ev.data.$.button == 2 ) 453 { 454 var target = ev.data.getTarget(); 455 456 // Prevent right click from selecting an empty block even 457 // when selection is anchored inside it. (#5845) 458 if ( !target.getOuterHtml().replace( emptyParagraphRegexp, '' ) ) 459 { 460 var range = new CKEDITOR.dom.range( domDocument ); 461 range.moveToElementEditStart( target ); 462 range.select( true ); 463 } 464 } 465 } ); 466 } 467 448 468 // Webkit: avoid from editing form control elements content. 449 469 if ( CKEDITOR.env.webkit ) 450 470 {