Skip to content

Commit

Permalink
Release v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
zenorocha committed Nov 9, 2015
1 parent 30f987d commit 0600312
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "select",
"version": "1.0.4",
"version": "1.0.5",
"description": "Programmatically select the text of a HTML element",
"license": "MIT",
"main": "dist/select.js",
Expand Down
5 changes: 3 additions & 2 deletions dist/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function select(element) {
var selectedText;

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

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

selectedText = selection.toString();
}

element.focus();

return selectedText;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "select",
"description": "Programmatically select the text of a HTML element",
"version": "1.0.4",
"version": "1.0.5",
"main": "src/select.js",
"repository": "zenorocha/select",
"keywords": [
Expand Down

0 comments on commit 0600312

Please sign in to comment.