| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
ve.ui.IndentationCommand = function VeUiIndentationCommand( name, method ) { |
| 18 |
|
| 19 |
ve.ui.IndentationCommand.super.call( |
| 20 |
this, name, 'indentation', method, |
| 21 |
{ supportedSelections: [ 'linear' ] } |
| 22 |
); |
| 23 |
}; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
OO.inheritClass( ve.ui.IndentationCommand, ve.ui.Command ); |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
ve.ui.IndentationCommand.prototype.isExecutable = function ( fragment ) { |
| 35 |
|
| 36 |
if ( !ve.ui.IndentationCommand.super.prototype.isExecutable.apply( this, arguments ) ) { |
| 37 |
return false; |
| 38 |
} |
| 39 |
return fragment.hasMatchingAncestor( 'listItem' ); |
| 40 |
}; |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
ve.ui.commandRegistry.register( new ve.ui.IndentationCommand( 'indent', 'increase' ) ); |
| 45 |
|
| 46 |
ve.ui.commandRegistry.register( new ve.ui.IndentationCommand( 'outdent', 'decrease' ) ); |