Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
acusti committed Apr 9, 2017
1 parent 3e24144 commit 5611a1b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/renderers/dom/shared/ReactInputSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ function getElementsWithSelections(acc, win) {
var startOffset = selection.anchorOffset;
var endOffset = selection.focusOffset;
if (startNode && startNode.childNodes.length) {
if (startNode.childNodes[startOffset] === endNode.childNodes[endOffset]) {
element = startNode.childNodes[startOffset];
}
if (startNode.childNodes[startOffset] === endNode.childNodes[endOffset]) {
element = startNode.childNodes[startOffset];
}
} else {
element = startNode;
}
element = startNode;
}
}
} else if (doc.selection) {
var range = doc.selection.createRange();
Expand Down Expand Up @@ -134,8 +134,9 @@ var ReactInputSelection = {
restoreSelection: function(priorSelectionInformation) {
priorSelectionInformation.activeElements.forEach(function(activeElement) {
var element = activeElement.element;
if (isInDocument(element) &&
getActiveElement(element.ownerDocument) !== element) {
if (
isInDocument(element) && getActiveElement(element.ownerDocument) !== element
) {
if (ReactInputSelection.hasSelectionCapabilities(element)) {
ReactInputSelection.setSelection(
element,
Expand All @@ -148,8 +149,9 @@ var ReactInputSelection = {

var curFocusedElement = getFocusedElement();
var priorFocusedElement = priorSelectionInformation.focusedElement;
if (curFocusedElement !== priorFocusedElement &&
isInDocument(priorFocusedElement)) {
if (
curFocusedElement !== priorFocusedElement && isInDocument(priorFocusedElement)
) {
focusNodePreservingScroll(priorFocusedElement);
}
},
Expand Down

0 comments on commit 5611a1b

Please sign in to comment.