Changeset 3894
- Timestamp:
- 07/14/09 12:46:34 (4 years ago)
- Location:
- CKEditor/trunk
- Files:
-
- 3 edited
-
CHANGES.html (modified) (1 diff)
-
_source/plugins/list/plugin.js (modified) (2 diffs)
-
_source/tests/plugins/list/list.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/trunk/CHANGES.html
r3893 r3894 130 130 <li><a href="http://dev.fckeditor.net/ticket/3742">#3742</a> : Fixed wrong dialog layout for dialogs without tab bar in IE RTL mode .</li> 131 131 <li><a href="http://dev.fckeditor.net/ticket/3671">#3671</a> : Fixed body fixing should be applied to the real type under fake elements.</li> 132 <li><a href="http://dev.fckeditor.net/ticket/3836">#3836</a> : Fixed remove list in enterMode=BR will merge sibling text to one line.</li> 132 133 </ul> 133 134 <h3> -
CKEditor/trunk/_source/plugins/list/plugin.js
r3771 r3894 336 336 337 337 var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode ); 338 339 // Compensate a <br> before the first node if the previous node of list is a non-blocks.(#3836) 340 var docFragment = newList.listNode, firstNode, previousNode; 341 if ( ( firstNode = docFragment.getFirst() ) 342 && !( firstNode.is && firstNode.isBlockBoundary() ) 343 && ( previousNode = groupObj.root.getPrevious( true ) ) 344 && !( previousNode.is && previousNode.isBlockBoundary( { br : 1 } ) ) ) 345 editor.document.createElement( 'br' ).insertBefore( firstNode ); 346 338 347 // If groupObj.root is the last element in its parent, or its nextSibling is a <br>, then we should 339 348 // not add a <br> after the final item. So, check for the cases and trim the <br>. … … 343 352 newList.listNode.getLast().remove(); 344 353 } 345 newList.listNode.replace( groupObj.root );354 docFragment.replace( groupObj.root ); 346 355 } 347 356 -
CKEditor/trunk/_source/tests/plugins/list/list.html
r3781 r3894 162 162 }, 163 163 164 /** 165 * Test remove list first list item not merging with previous text node. 166 */ 167 test_ticket_3836 : function() 168 { 169 prepareEditor( 'test_ticket_3836_editor', null, 170 { enterMode : CKEDITOR.ENTER_BR }, 171 function( editor ) 172 { 173 this.resume( function() 174 { 175 editor.focus(); 176 177 var doc = editor.document, 178 range = new CKEDITOR.dom.range( doc ); 179 setRange( range, [ 1, 1, 0, 0 ], [ 1, 1, 1, 1 ] ); 180 debugger; 181 var sel = editor.getSelection(); 182 sel.selectRanges( [ range ] ); 183 184 // Waiting for 'comand state' effected. 185 this.wait( function(){ 186 // Remove list. 187 editor.execCommand( 'bulletedlist' ); 188 assert.areSame( getTextAreaValue( 'test_ticket_3836_result' ), 189 editor.getData(), 190 'Remove list result not correct.' ); 191 }, 1000 ); 192 193 } ); 194 }, this ); 195 this.wait(); 196 }, 197 164 198 name :document.title 165 199 }; … … 175 209 <textarea id="test_ticket_3773_editor"><ol><li>line1</li><li>line2</li></ol></textarea> 176 210 <textarea id="test_ticket_3773_result">line1<br />line2</textarea> 211 <textarea id="test_ticket_3836_editor">line1<ul><li>item1</li><li>item2</li></ul>line2</textarea> 212 <textarea id="test_ticket_3836_result">line1<br />item1<br />item2<br />line2</textarea> 177 213 </body> 178 214 </html>
Note: See TracChangeset
for help on using the changeset viewer.
