From a44ce513918f57968984bfae3f39eb8d6763dd13 Mon Sep 17 00:00:00 2001 From: Eric Biewener Date: Thu, 3 Nov 2016 18:09:30 -0700 Subject: [PATCH] Allow indentation beyond one level deeper than block above. Also don't require there to even be a block above to begin indenting. --- src/model/modifier/RichTextEditorUtil.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/model/modifier/RichTextEditorUtil.js b/src/model/modifier/RichTextEditorUtil.js index 3e151650d2..4a5b84c3c2 100644 --- a/src/model/modifier/RichTextEditorUtil.js +++ b/src/model/modifier/RichTextEditorUtil.js @@ -207,28 +207,11 @@ const RichTextEditorUtil = { event.preventDefault(); - // Only allow indenting one level beyond the block above, and only if - // the block above is a list item as well. - var blockAbove = content.getBlockBefore(key); - if (!blockAbove) { - return editorState; - } - - var typeAbove = blockAbove.getType(); - if ( - typeAbove !== 'unordered-list-item' && - typeAbove !== 'ordered-list-item' - ) { - return editorState; - } - var depth = block.getDepth(); if (!event.shiftKey && depth === maxDepth) { return editorState; } - maxDepth = Math.min(blockAbove.getDepth() + 1, maxDepth); - var withAdjustment = adjustBlockDepthForContentState( content, selection,