()
| 438 | } |
| 439 | |
| 440 | decreaseListLevel() { |
| 441 | let [ startPosition ] = Array.from(this.getSelectedRange()) |
| 442 | const { index } = this.document.locationFromPosition(startPosition) |
| 443 | let endIndex = index |
| 444 | const attributeLevel = this.getBlock().getAttributeLevel() |
| 445 | |
| 446 | let block = this.document.getBlockAtIndex(endIndex + 1) |
| 447 | while (block) { |
| 448 | if (!block.isListItem() || block.getAttributeLevel() <= attributeLevel) { |
| 449 | break |
| 450 | } |
| 451 | endIndex++ |
| 452 | block = this.document.getBlockAtIndex(endIndex + 1) |
| 453 | } |
| 454 | |
| 455 | startPosition = this.document.positionFromLocation({ index, offset: 0 }) |
| 456 | const endPosition = this.document.positionFromLocation({ index: endIndex, offset: 0 }) |
| 457 | return this.setDocument(this.document.removeLastListAttributeAtRange([ startPosition, endPosition ])) |
| 458 | } |
| 459 | |
| 460 | updateCurrentAttributes() { |
| 461 | const selectedRange = this.getSelectedRange({ ignoreLock: true }) |
no test coverage detected