Ticket #6141: 6141_3.patch
File 6141_3.patch, 2.1 KB (added by , 14 years ago) |
---|
-
_source/plugins/indent/plugin.js
256 256 } 257 257 else 258 258 { 259 var indentCssProperty = getIndentCssProperty( element ); 260 var currentOffset = parseInt( element.getStyle( indentCssProperty ), 10 ); 259 var indentCssProperty = getIndentCssProperty( element ), 260 currentOffset = parseInt( element.getStyle( indentCssProperty ), 10 ); 261 // For lists, when indentOffset == 0 we must use 1 instead of zero here so it'll be possible to indent it. (#6141) 261 262 if ( isNaN( currentOffset ) ) 262 263 currentOffset = 0; 263 264 currentOffset += ( self.name == 'indent' ? 1 : -1 ) * editor.config.indentOffset; … … 283 284 284 285 var skipBookmarks = function( node ) 285 286 { 286 return ! 287 return !node.hasAttribute( '_cke_bookmark' ); 287 288 }; 288 289 289 290 var iterator = ranges.createIterator(); … … 321 322 range.endContainer = walker.previous(); 322 323 } 323 324 324 if ( nearestListBlock 325 if ( nearestListBlock ) 325 326 { 326 327 var firstListItem = nearestListBlock.getFirst( function( node ) 327 328 { … … 330 331 rangeStart = range.startContainer, 331 332 indentWholeList = firstListItem.equals( rangeStart ) || firstListItem.contains( rangeStart ); 332 333 333 // Indent the entire list if cursor is inside the first list item. (#3893) 334 if ( !( indentWholeList && indentElement( nearestListBlock ) ) ) 335 indentList( nearestListBlock ); 334 // Indent the entire list if cursor is inside the first list item. (#3893) 335 // Only do that for indenting or when there is something to outdent. (#6141) 336 if ( !( indentWholeList && 337 ( self.name == 'indent' || parseInt( nearestListBlock.getStyle( getIndentCssProperty( nearestListBlock ) ), 10 ) ) && 338 indentElement( nearestListBlock ) ) ) 339 indentList( nearestListBlock ); 336 340 } 337 341 else 338 342 indentBlock();