From b59e2ec863026d6c92d1a1fd1602312c7d882052 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 28 Nov 2009 17:54:02 +0100 Subject: fixed IE text selection (needs testing) FS#1808 Ignore-this: c8405fda4cbf2e1fa9d89609e1df666e This seems to fix the text seelction problem in IE when the selection starts or ends at a newline. This was only tested in IE8 so far but should work in IE6 and IE7, too. Please provide feedback if not. darcs-hash:20091128165402-7ad00-cb9a38e7f245b441afe40a15422930ad60805a56.gz --- lib/scripts/textselection.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/scripts/textselection.js b/lib/scripts/textselection.js index b99e8a4a5..76cc6bcbb 100644 --- a/lib/scripts/textselection.js +++ b/lib/scripts/textselection.js @@ -81,8 +81,8 @@ function getSelection(textArea) { } else { before_range.moveEnd("character", -1); if (before_range.text == before_text) { - sel.start++; - sel.end++; + sel.start += 2; + sel.end += 2; } else { before_finished = true; } @@ -94,7 +94,7 @@ function getSelection(textArea) { } else { sel.rangeCopy.moveEnd("character", -1); if (sel.rangeCopy.text == selection_text) { - sel.end++; + sel.end += 2; } else { selection_finished = true; } -- cgit v1.2.3