Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
Prev Previous commit
Next Next commit
Linting
  • Loading branch information
acusti committed Oct 30, 2017
commit db5443161a10c3df3a75b6c3ecca05a59dfefb9a
5 changes: 1 addition & 4 deletions src/component/contents/DraftEditorBlock.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ class DraftEditorBlock extends React.Component<Props> {
);
}
} else {
invariant(
blockNode.nodeType === 1,
'blockNode is not an Element',
);
invariant(blockNode.nodeType === 1, 'blockNode is not an Element');
var blockBottom = blockNode.offsetHeight + blockNode.offsetTop;
var scrollBottom = scrollParent.offsetHeight + scrollPosition.y;
scrollDelta = blockBottom - scrollBottom;
Expand Down
5 changes: 3 additions & 2 deletions src/component/handlers/edit/editOnInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ function editOnInput(editor: DraftEditor): void {
editor._pendingStateFromBeforeInput = undefined;
}

var domSelection = ReactDOM.findDOMNode(editor.refs.editor)
.ownerDocument.defaultView.getSelection();
var domSelection = ReactDOM.findDOMNode(
editor.refs.editor,
).ownerDocument.defaultView.getSelection();

var {anchorNode, isCollapsed} = domSelection;
const isNotTextNode = anchorNode.nodeType !== Node.TEXT_NODE;
Expand Down
6 changes: 4 additions & 2 deletions src/component/selection/getDraftEditorSelectionWithNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ function getPointForNonTextNode(
if (editorRoot === node) {
node = node.firstChild;
invariant(
node && node.nodeType === 1 && typeof node.getAttribute === 'function' &&
node.getAttribute('data-contents') === 'true',
node &&
node.nodeType === 1 &&
typeof node.getAttribute === 'function' &&
node.getAttribute('data-contents') === 'true',
'Invalid DraftEditorContents structure.',
);
if (childOffset > 0) {
Expand Down
1 change: 0 additions & 1 deletion src/component/selection/setDraftEditorSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ function setDraftEditorSelection(
nodeStart: number,
nodeEnd: number,
): void {

var ownerDocument = node.ownerDocument;

// It's possible that the editor has been removed from the DOM but
Expand Down