Parcourir la source

Align code to the latest changes in engine API.

Maciej Gołaszewski il y a 6 ans
Parent
commit
8c46def3b3
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  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' ) );
 }