瀏覽代碼

Align code to the latest changes in engine API.

Maciej Gołaszewski 6 年之前
父節點
當前提交
8c46def3b3
共有 1 個文件被更改,包括 2 次插入2 次删除
  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' ) );
 }