From 3d94a93d431a56d7bade37ef0d4d6ea418722218 Mon Sep 17 00:00:00 2001 From: Szymon Cofalik Date: Thu, 30 Mar 2017 09:00:41 +0200 Subject: [PATCH] Changed: used `first` util instead of manually obtaining first item from iterator. --- src/blockquotecommand.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blockquotecommand.js b/src/blockquotecommand.js index 82be4d9..77b90b2 100644 --- a/src/blockquotecommand.js +++ b/src/blockquotecommand.js @@ -46,7 +46,7 @@ export default class BlockQuoteCommand extends Command { * Updates command's {@link #value} based on the current selection. */ refreshValue() { - const firstBlock = this.editor.document.selection.getSelectedBlocks().next().value; + const firstBlock = first( this.editor.document.selection.getSelectedBlocks() ); // In the current implementation, the block quote must be an immediate parent of a block element. this.value = !!( firstBlock && findQuote( firstBlock ) );