Ticket #6023: 6023.patch
File 6023.patch, 2.1 KB (added by , 14 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
38 38 39 39 insertFunc.call( this, evt.data ); 40 40 41 postDomFixing.call( this ); 42 41 43 // Save snaps after the whole execution completed. 42 44 // This's a workaround for make DOM modification's happened after 43 45 // 'insertElement' to be included either, e.g. Form-based dialogs' 'commitContents' … … 375 377 } 376 378 } 377 379 380 if ( CKEDITOR.env.opera && range.collapsed ) 381 { 382 var start = range.startContainer; 383 if ( start.type == CKEDITOR.NODE_ELEMENT 384 && start.getName() in CKEDITOR.dtd.$listItem 385 && range.checkStartOfBlock() && range.checkEndOfBlock() ) 386 { 387 fixEmptyListItem( start ); 388 } 389 } 390 378 391 // When enterMode set to block, we'll establing new paragraph only if we're 379 392 // selecting inline contents right under body. (#3657) 380 393 if ( enterMode != CKEDITOR.ENTER_BR … … 463 476 } 464 477 } 465 478 479 function postDomFixing() 480 { 481 if ( CKEDITOR.env.opera ) 482 { 483 var listItems = this.document.getElementsByTag( 'li' ), 484 length = listItems.count(); 485 486 for ( var i = 0; i < length; i++ ) 487 fixEmptyListItem( listItems.getItem( i ) ); 488 } 489 } 490 491 // Opera doesn't display empty list item bullet well with a bogus br, 492 // empty text node to the rescue. (#6023) 493 function fixEmptyListItem( element ) 494 { 495 if ( element.$.children.length == 1 && element.getFirst().is( 'br' ) ) 496 element.getDocument().createText( '' ).replace( element.getFirst() ); 497 } 498 466 499 CKEDITOR.plugins.add( 'wysiwygarea', 467 500 { 468 501 requires : [ 'editingblock' ], … … 1131 1164 var title = editor.document.getElementsByTag( 'title' ).getItem( 0 ); 1132 1165 title.data( 'cke-title', editor.document.$.title ); 1133 1166 editor.document.$.title = frameLabel; 1167 1168 postDomFixing.call( editor ); 1134 1169 }); 1135 1170 1136 1171 // IE>=8 stricts mode doesn't have 'contentEditable' in effect