Skip to content

Commit

Permalink
Source formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zenorocha committed Nov 9, 2015
1 parent d073a23 commit 30f987d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ function select(element) {
var selectedText;

if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
element.focus();
element.setSelectionRange(0, element.value.length);

selectedText = element.value;
Expand All @@ -14,11 +13,12 @@ function select(element) {
range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
element.focus();

selectedText = selection.toString();
}

element.focus();

return selectedText;
}

Expand Down

0 comments on commit 30f987d

Please sign in to comment.