Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
acusti committed May 4, 2017
1 parent 9e16980 commit fc9dd51
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 @@ -57,12 +57,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 @@ -137,8 +137,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 @@ -151,8 +152,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 fc9dd51

Please sign in to comment.