summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-12-03 16:16:39 +0200
committerAlon Levy <alon@pobox.com>2014-12-03 16:16:39 +0200
commit6d1d801925f4546cc16b56759f5108733fd548ba (patch)
tree66b94e354050f219abacad8970ad39d01c6b4780 /lib
parent71e73684c5c9efe4302fc7f406eef785d9713449 (diff)
library: Fix TypeError: variable _ redeclares argument
Diffstat (limited to 'lib')
-rw-r--r--lib/caret.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/caret.js b/lib/caret.js
index 758600d0..017e96f3 100644
--- a/lib/caret.js
+++ b/lib/caret.js
@@ -31,10 +31,10 @@ function($) {
return range2.text.length;
}
//textarea
- var pos = 0,
- range = target.createTextRange(),
+ var range = target.createTextRange(),
range2 = document.selection.createRange().duplicate(),
bookmark = range2.getBookmark();
+ pos = 0;
range.moveToBookmark(bookmark);
while (range.moveStart('character', -1) !== 0) pos++;
return pos;