From 30f987d1330697db46a1d8f2630c58744809f8d9 Mon Sep 17 00:00:00 2001 From: Zeno Rocha Date: Sun, 8 Nov 2015 19:17:31 -0800 Subject: [PATCH] Source formatting --- src/select.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/select.js b/src/select.js index 881c016..42c818e 100644 --- a/src/select.js +++ b/src/select.js @@ -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; @@ -14,11 +13,12 @@ function select(element) { range.selectNodeContents(element); selection.removeAllRanges(); selection.addRange(range); - element.focus(); selectedText = selection.toString(); } + element.focus(); + return selectedText; }