Ticket #6479: 6479_3.patch
File 6479_3.patch, 2.2 KB (added by , 13 years ago) |
---|
-
_source/plugins/enterkey/plugin.js
98 98 } 99 99 else 100 100 { 101 var newBlock; 101 var newBlock, 102 newBlockDir; 102 103 103 104 if ( previousBlock ) 104 105 { … … 115 116 newBlock = nextBlock.clone(); 116 117 117 118 if ( !newBlock ) 119 { 118 120 newBlock = doc.createElement( blockTag ); 121 if ( previousBlock && ( newBlockDir = previousBlock.getDirection() ) ) 122 newBlock.setAttribute( 'dir', newBlockDir ); 123 } 119 124 // Force the enter block unless we're talking of a list item. 120 125 else if ( forceMode && !newBlock.is( 'li' ) ) 121 126 newBlock.renameNode( blockTag ); … … 222 227 // If we are at the end of a header block. 223 228 if ( !forceMode && isEndOfBlock && headerTagRegex.test( startBlockTag ) ) 224 229 { 225 // Insert a <br> after the current paragraph. 226 doc.createElement( 'br' ).insertAfter( startBlock ); 230 var newBlock, 231 newBlockDir; 232 233 if ( newBlockDir = startBlock.getDirection() ) 234 { 235 newBlock = doc.createElement( 'div' ); 236 newBlock.setAttribute( 'dir', newBlockDir ); 237 newBlock.insertAfter( startBlock ); 238 range.setStart( newBlock, 0 ); 239 } 240 else 241 { 242 // Insert a <br> after the current paragraph. 243 doc.createElement( 'br' ).insertAfter( startBlock ); 227 244 228 // A text node is required by Gecko only to make the cursor blink.229 if ( CKEDITOR.env.gecko )230 doc.createText( '' ).insertAfter( startBlock );245 // A text node is required by Gecko only to make the cursor blink. 246 if ( CKEDITOR.env.gecko ) 247 doc.createText( '' ).insertAfter( startBlock ); 231 248 232 // IE has different behaviors regarding position. 233 range.setStartAt( startBlock.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START ); 249 // IE has different behaviors regarding position. 250 range.setStartAt( startBlock.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START ); 251 } 234 252 } 235 253 else 236 254 {