IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
139 | 139 | // Apply indenting or outdenting on the array. |
140 | 140 | var baseIndent = listArray[ lastItem.getCustomData( 'listarray_index' ) ].indent; |
141 | 141 | for ( i = startItem.getCustomData( 'listarray_index' ); i <= lastItem.getCustomData( 'listarray_index' ); i++ ) |
142 | | { |
143 | 142 | listArray[ i ].indent += indentOffset; |
144 | | // Make sure the newly created sublist get a brand-new element of the same type. (#5372) |
145 | | var listRoot = listArray[ i ].parent; |
146 | | listArray[ i ].parent = new CKEDITOR.dom.element( listRoot.getName(), listRoot.getDocument() ); |
147 | | } |
148 | 143 | |
149 | 144 | for ( i = lastItem.getCustomData( 'listarray_index' ) + 1 ; |
150 | 145 | i < listArray.length && listArray[i].indent > baseIndent ; i++ ) |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
| 34 | // Inheirt inline styles from another element. |
| 35 | function inheirtInlineStyles( parent, el ) |
| 36 | { |
| 37 | var style = parent.getAttribute( 'style' ); |
| 38 | |
| 39 | // Put parent styles before child styles. |
| 40 | style && el.setAttribute( 'style', |
| 41 | style.replace( /([^;])$/, '$1;' ) + |
| 42 | ( el.getAttribute( 'style' ) || '' ) ); |
| 43 | } |
| 44 | |
34 | 45 | CKEDITOR.plugins.list = { |
35 | 46 | /* |
36 | 47 | * Convert a DOM list tree into a data structure that is easier to |
… |
… |
|
108 | 119 | paragraphName = ( paragraphMode == CKEDITOR.ENTER_P ? 'p' : 'div' ); |
109 | 120 | while ( 1 ) |
110 | 121 | { |
111 | | var item = listArray[ currentIndex ]; |
| 122 | var item = listArray[ currentIndex ], |
| 123 | itemParent = item.parent; |
112 | 124 | |
113 | 125 | orgDir = item.element.getDirection( 1 ); |
114 | 126 | |
… |
… |
|
116 | 128 | { |
117 | 129 | if ( !rootNode || listArray[ currentIndex ].parent.getName() != rootNode.getName() ) |
118 | 130 | { |
119 | | rootNode = listArray[ currentIndex ].parent.clone( false, 1 ); |
| 131 | // Make sure the newly created sub list NOT inheriting styles from parent. (#5372) |
| 132 | rootNode = baseIndex ? doc.createElement( itemParent.getName() ) : itemParent.clone( false, 1 ); |
120 | 133 | dir && rootNode.setAttribute( 'dir', dir ); |
121 | 134 | retval.append( rootNode ); |
122 | 135 | } |
… |
… |
|
146 | 159 | } |
147 | 160 | else if ( item.indent == -1 && !baseIndex && item.grandparent ) |
148 | 161 | { |
| 162 | // We're leaving this parent list, inherit it's inline styles. |
| 163 | var listNode = itemParent.clone(); |
| 164 | if ( listNode.hasAttribute( 'style' ) ) |
| 165 | { |
| 166 | listNode.removeStyle( 'list-style-type' ); |
| 167 | inheirtInlineStyles( listNode, item.element ); |
| 168 | } |
| 169 | |
149 | 170 | if ( listNodeNames[ item.grandparent.getName() ] ) |
150 | 171 | currentListItem = item.element.clone( false, true ); |
151 | 172 | else |
… |
… |
|
171 | 192 | if ( dirLoose && !child.getDirection() ) |
172 | 193 | child.setAttribute( 'dir', orgDir ); |
173 | 194 | |
174 | | // Merge into child styles. |
175 | | style && child.setAttribute( 'style', |
176 | | style.replace( /([^;])$/, '$1;') + |
177 | | ( child.getAttribute( 'style' ) || '' ) ); |
| 195 | inheirtInlineStyles( li, child ); |
178 | 196 | |
179 | 197 | className && child.addClass( className ); |
180 | 198 | } |