8
0
Просмотр исходного кода

Merge pull request #17 from ckeditor/t/ckeditor5-widget/95

Internal: Align code to the changes in selection API.
Piotrek Koszuliński 6 лет назад
Родитель
Сommit
3206cbf214
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' ) );
 }