diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2010-01-26 10:23:46 +0100 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2010-01-26 10:23:46 +0100 |
commit | 3c743051cd4555135bdbf55c27733a2281463b4c (patch) | |
tree | a55aabc9a8045dc23a3d0e88b8d96ad96e5597eb | |
parent | 912f066b170a7a39fbd7d19fd96c48f820c72926 (diff) | |
download | rpg-3c743051cd4555135bdbf55c27733a2281463b4c.tar.gz rpg-3c743051cd4555135bdbf55c27733a2281463b4c.tar.bz2 |
do not use "editor cleverness" on selected text
This patch disables all keyhandling (as used for automatic list indention)
when some text is selected. This fixes unexpected behavior when selecting
some text at the start of a list item and hitting backspace.
-rw-r--r-- | lib/scripts/edit.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index a80c8a06e..d7391b7e7 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -152,6 +152,7 @@ function keyHandler(e){ e.keyCode != 32) return; var field = e.target; var selection = getSelection(field); + if(selection.getLength()) return; //there was text selected, keep standard behavior var search = "\n"+field.value.substr(0,selection.start); var linestart = Math.max(search.lastIndexOf("\n"), search.lastIndexOf("\r")); //IE workaround |