8
0
Quellcode durchsuchen

Align code to the latest changes in engine API.

Maciej Gołaszewski vor 6 Jahren
Ursprung
Commit
8c46def3b3
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      packages/ckeditor5-indent/src/indentblockcommand.js

+ 2 - 2
packages/ckeditor5-indent/src/indentblockcommand.js

@@ -53,7 +53,7 @@ export default class IndentBlockCommand extends Command {
 		const editor = this.editor;
 		const model = editor.model;
 
-		const block = first( model.document.selection.getTopMostBlocks() );
+		const block = first( model.document.selection.getSelectedBlocks() );
 
 		if ( !block || !model.schema.checkAttribute( block, 'blockIndent' ) ) {
 			this.isEnabled = false;
@@ -94,7 +94,7 @@ export default class IndentBlockCommand extends Command {
 function getBlocksToChange( model ) {
 	const selection = model.document.selection;
 	const schema = model.schema;
-	const blocksInSelection = Array.from( selection.getTopMostBlocks() );
+	const blocksInSelection = Array.from( selection.getSelectedBlocks() );
 
 	return blocksInSelection.filter( block => schema.checkAttribute( block, 'blockIndent' ) );
 }