Ticket #7566: 7566.patch
File 7566.patch, 2.9 KB (added by , 13 years ago) |
---|
-
_source/plugins/list/plugin.js
87 87 currentIndex = baseIndex, 88 88 indentLevel = Math.max( listArray[ baseIndex ].indent, 0 ), 89 89 currentListItem = null, 90 itemDir,90 orgDir, 91 91 paragraphName = ( paragraphMode == CKEDITOR.ENTER_P ? 'p' : 'div' ); 92 92 while ( 1 ) 93 93 { 94 94 var item = listArray[ currentIndex ]; 95 96 orgDir = item.element.getDirection( 1 ); 97 95 98 if ( item.indent == indentLevel ) 96 99 { 97 100 if ( !rootNode || listArray[ currentIndex ].parent.getName() != rootNode.getName() ) … … 101 104 retval.append( rootNode ); 102 105 } 103 106 currentListItem = rootNode.append( item.element.clone( 0, 1 ) ); 107 108 if ( orgDir != rootNode.getDirection( 1 ) ) 109 currentListItem.setAttribute( 'dir', orgDir ); 110 104 111 for ( var i = 0 ; i < item.contents.length ; i++ ) 105 112 currentListItem.append( item.contents[i].clone( 1, 1 ) ); 106 113 currentIndex++; … … 108 115 else if ( item.indent == Math.max( indentLevel, 0 ) + 1 ) 109 116 { 110 117 // Maintain original direction (#6861). 111 var orgDir = item.element.getDirection( 1 ), 112 currDir = listArray[ currentIndex - 1 ].element.getDirection( 1 ), 118 var currDir = listArray[ currentIndex - 1 ].element.getDirection( 1 ), 113 119 listData = CKEDITOR.plugins.list.arrayToList( listArray, null, currentIndex, paragraphMode, 114 120 currDir != orgDir ? orgDir: null ); 115 121 … … 124 130 else if ( item.indent == -1 && !baseIndex && item.grandparent ) 125 131 { 126 132 if ( listNodeNames[ item.grandparent.getName() ] ) 127 {128 133 currentListItem = item.element.clone( false, true ); 129 itemDir = item.element.getDirection( 1 );130 item.grandparent.getDirection( 1 ) != itemDir &&131 currentListItem.setAttribute( 'dir', itemDir );132 }133 134 else 134 135 { 135 136 // Create completely new blocks here. … … 137 138 { 138 139 currentListItem = doc.createElement( paragraphName ); 139 140 item.element.copyAttributes( currentListItem, { type:1, value:1 } ); 140 itemDir = item.element.getDirection() || dir;141 itemDir &&142 currentListItem.setAttribute( 'dir', itemDir );143 141 144 142 // There might be a case where there are no attributes in the element after all 145 143 // (i.e. when "type" or "value" are the only attributes set). In this case, if enterMode = BR, … … 151 149 currentListItem = new CKEDITOR.dom.documentFragment( doc ); 152 150 } 153 151 152 if ( item.grandparent.getDirection( 1 ) != orgDir && currentListItem.type == CKEDITOR.NODE_ELEMENT ) 153 currentListItem.setAttribute( 'dir', orgDir ); 154 154 155 for ( i = 0 ; i < item.contents.length ; i++ ) 155 156 currentListItem.append( item.contents[i].clone( 1, 1 ) ); 156 157