Ticket #3509: 3509_2.patch
File 3509_2.patch, 2.6 KB (added by , 15 years ago) |
---|
-
_source/plugins/enterkey/plugin.js
139 139 if ( !newBlock ) 140 140 newBlock = doc.createElement( blockTag ); 141 141 142 // We need to insert the bogus element inside all of the inline 143 // style elements, so that clicking after the line or pressing end 144 // and typing makes the typed text keep these inline styles. 145 var blockWithBogus = newBlock; 146 142 147 // Recreate the inline elements tree, which was available 143 148 // before hitting enter, so the same styles will be available in 144 149 // the new block. … … 157 162 element = element.clone(); 158 163 newBlock.moveChildren( element ); 159 164 newBlock.append( element ); 165 166 blockWithBogus = element; 160 167 } 161 168 } 162 169 } 163 170 164 171 if ( !CKEDITOR.env.ie ) 165 newBlock.appendBogus();172 blockWithBogus.appendBogus(); 166 173 167 174 range.insertNode( newBlock ); 168 175 -
_source/core/dom/element.js
243 243 lastChild = lastChild.getPrevious(); 244 244 if ( !lastChild || !lastChild.is || !lastChild.is( 'br' ) ) 245 245 { 246 this.append( 247 CKEDITOR.env.opera ? 248 this.getDocument().createText('') : 249 this.getDocument().createElement( 'br' ) ); 246 var bogusElement = CKEDITOR.env.opera ? 247 this.getDocument().createText( '' ) : 248 this.getDocument().createElement( 'br' ); 249 this.append( bogusElement ); 250 return bogusElement; 250 251 } 251 252 }, 252 253 -
_source/core/dom/range.js
1299 1299 1300 1300 this.collapse( isStart ); 1301 1301 1302 // If endContainer is at the end of the document, we need to create 1303 // a bogus element so that the range can include the entire endContainer. 1304 // (This isn't necessary otherwise, but doesn't hurt.) 1305 var tempBogus = null; 1306 if ( !CKEDITOR.env.ie ) 1307 tempBogus = this.endContainer.getParent().appendBogus(); 1308 1302 1309 this.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS ); 1303 1310 1304 1311 this.extractContents().appendTo( fixedBlock ); … … 1307 1314 if ( !CKEDITOR.env.ie ) 1308 1315 fixedBlock.appendBogus(); 1309 1316 1317 if ( tempBogus ) 1318 tempBogus.remove(); 1319 1310 1320 this.insertNode( fixedBlock ); 1311 1321 1312 1322 this.moveToBookmark( bookmark );