Ticket #5911: 5911_2.patch
File 5911_2.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; … … 110 110 { 111 111 // Create completely new blocks here, attributes are dropped. 112 112 if ( 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 119 // Should we set DIR attribute on this one ? 115 120 currentListItem = new CKEDITOR.dom.documentFragment( doc ); 116 121 } 117 122 … … 280 285 281 286 // Insert the list to the DOM tree. 282 287 var insertAnchor = listContents[ listContents.length - 1 ].getNext(), 283 listNode = doc.createElement( this.type ); 288 listNode = doc.createElement( this.type ), 289 dir; 284 290 285 291 listsCreated.push( listNode ); 286 292 while ( listContents.length ) … … 293 299 contentBlock.appendTo( listItem ); 294 300 else 295 301 { 302 if ( contentBlock.hasAttribute( 'dir' ) ) 303 { 304 dir = dir || contentBlock.getAttribute( 'dir' ); 305 contentBlock.removeAttribute( 'dir' ); 306 } 296 307 contentBlock.copyAttributes( listItem ); 297 308 contentBlock.moveChildren( listItem ); 298 309 contentBlock.remove(); … … 304 315 if ( !CKEDITOR.env.ie ) 305 316 listItem.appendBogus(); 306 317 } 318 319 if ( dir ) 320 listNode.setAttribute( 'dir', dir ); 321 307 322 if ( insertAnchor ) 308 323 listNode.insertBefore( insertAnchor ); 309 324 else … … 353 368 } 354 369 } 355 370 356 var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode ); 371 var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode, 372 groupObj.root.getAttribute( 'dir' ) ); 357 373 358 374 // Compensate <br> before/after the list node if the surrounds are non-blocks.(#3836) 359 375 var docFragment = newList.listNode, boundaryNode, siblingNode;