mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-27 00:54:22 +02:00
Fixed linting errors
This commit is contained in:
@@ -530,17 +530,17 @@ function Plugin(options = {}) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function onKeyDownUp(e, data, state) {
|
function onKeyDownUp(e, data, state) {
|
||||||
if (!IS_MAC || data.isCtrl || !data.isAlt || !data.isShift) return;
|
if (!IS_MAC || data.isCtrl || !data.isAlt || !data.isShift) return
|
||||||
e.preventDefault();
|
e.preventDefault()
|
||||||
const {selection, document, focusBlock} = state
|
const {selection, document, focusBlock} = state
|
||||||
const isStart = selection.hasFocusAtStartOf(focusBlock)
|
const isStart = selection.hasFocusAtStartOf(focusBlock)
|
||||||
const selectBlock = isStart ? document.getPreviousBlock(focusBlock.get('key')) : focusBlock;
|
const selectBlock = isStart ? document.getPreviousBlock(focusBlock.get('key')) : focusBlock
|
||||||
if (!selectBlock) return;
|
if (!selectBlock) return
|
||||||
var selectText = selectBlock.getTextAtOffset(0);
|
const selectText = selectBlock.getTextAtOffset(0)
|
||||||
return state
|
return state
|
||||||
.transform()
|
.transform()
|
||||||
.extendToStartOf(selectText)
|
.extendToStartOf(selectText)
|
||||||
.apply();
|
.apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -561,17 +561,17 @@ function Plugin(options = {}) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function onKeyDownDown(e, data, state) {
|
function onKeyDownDown(e, data, state) {
|
||||||
if (!IS_MAC || data.isCtrl || !data.isAlt || !data.isShift) return;
|
if (!IS_MAC || data.isCtrl || !data.isAlt || !data.isShift) return
|
||||||
e.preventDefault();
|
e.preventDefault()
|
||||||
const {selection, document, focusBlock} = state
|
const {selection, document, focusBlock} = state
|
||||||
const isEnd = selection.hasFocusAtEndOf(focusBlock)
|
const isEnd = selection.hasFocusAtEndOf(focusBlock)
|
||||||
const selectBlock = isEnd ? document.getNextBlock(focusBlock.get('key')) : focusBlock;
|
const selectBlock = isEnd ? document.getNextBlock(focusBlock.get('key')) : focusBlock
|
||||||
if (!selectBlock) return;
|
if (!selectBlock) return
|
||||||
var selectText = selectBlock.getTextAtOffset(selectBlock.length);
|
const selectText = selectBlock.getTextAtOffset(selectBlock.length)
|
||||||
return state
|
return state
|
||||||
.transform()
|
.transform()
|
||||||
.extendToEndOf(selectText)
|
.extendToEndOf(selectText)
|
||||||
.apply();
|
.apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user