Ticket #5911: 5911_3.patch
File 5911_3.patch, 2.3 KB (added by , 14 years ago) |
---|
-
_source/plugins/list/plugin.js
67 67 }, 68 68 69 69 // Convert our internal representation of a list back to a DOM forest. 70 arrayToList : function( listArray, database, baseIndex, paragraphMode )70 arrayToList : function( listArray, database, baseIndex, paragraphMode, dir ) 71 71 { 72 72 if ( !baseIndex ) 73 73 baseIndex = 0; … … 109 109 else 110 110 { 111 111 // Create completely new blocks here, attributes are dropped. 112 if ( paragraphMode != CKEDITOR.ENTER_BR && item.grandparent.getName() != 'td' ) 112 if ( dir || ( paragraphMode != CKEDITOR.ENTER_BR && item.grandparent.getName() != 'td' ) ) 113 { 113 114 currentListItem = doc.createElement( paragraphName ); 115 if ( dir ) 116 currentListItem.setAttribute( 'dir', dir ); 117 } 114 118 else 115 119 currentListItem = new CKEDITOR.dom.documentFragment( doc ); 116 120 } … … 280 284 281 285 // Insert the list to the DOM tree. 282 286 var insertAnchor = listContents[ listContents.length - 1 ].getNext(), 283 listNode = doc.createElement( this.type ); 287 listNode = doc.createElement( this.type ), 288 dir; 284 289 285 290 listsCreated.push( listNode ); 286 291 while ( listContents.length ) … … 293 298 contentBlock.appendTo( listItem ); 294 299 else 295 300 { 301 if ( contentBlock.hasAttribute( 'dir' ) ) 302 { 303 dir = dir || contentBlock.getAttribute( 'dir' ); 304 contentBlock.removeAttribute( 'dir' ); 305 } 296 306 contentBlock.copyAttributes( listItem ); 297 307 contentBlock.moveChildren( listItem ); 298 308 contentBlock.remove(); … … 304 314 if ( !CKEDITOR.env.ie ) 305 315 listItem.appendBogus(); 306 316 } 317 318 if ( dir ) 319 listNode.setAttribute( 'dir', dir ); 320 307 321 if ( insertAnchor ) 308 322 listNode.insertBefore( insertAnchor ); 309 323 else … … 353 367 } 354 368 } 355 369 356 var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode ); 370 var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode, 371 groupObj.root.getAttribute( 'dir' ) ); 357 372 358 373 // Compensate <br> before/after the list node if the surrounds are non-blocks.(#3836) 359 374 var docFragment = newList.listNode, boundaryNode, siblingNode;