mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-21 22:45:18 +02:00
Remove weird if/then/else
This commit is contained in:
@@ -262,8 +262,9 @@ function removeNode(state, operation) {
|
|||||||
.takeUntil(text => text.key == startKey)
|
.takeUntil(text => text.key == startKey)
|
||||||
.filter(text => !getRemoved(text.key))
|
.filter(text => !getRemoved(text.key))
|
||||||
.last()
|
.last()
|
||||||
if (!prevText) selection = selection.unset()
|
selection = !prevText
|
||||||
else selection = selection.moveStartTo(prevText.key, prevText.length)
|
? selection.unset()
|
||||||
|
: selection.moveStartTo(prevText.key, prevText.length)
|
||||||
}
|
}
|
||||||
if (endDesc) {
|
if (endDesc) {
|
||||||
// The whole selection is inside the node, we collapse to the previous text node
|
// The whole selection is inside the node, we collapse to the previous text node
|
||||||
@@ -276,8 +277,9 @@ function removeNode(state, operation) {
|
|||||||
.filter(text => !getRemoved(text.key))
|
.filter(text => !getRemoved(text.key))
|
||||||
.first()
|
.first()
|
||||||
|
|
||||||
if (!nextText) selection = selection.unset()
|
selection = !nextText
|
||||||
else selection = selection.moveEndTo(nextText.key, 0)
|
? selection.unset()
|
||||||
|
: selection.moveEndTo(nextText.key, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user