Skip to content
Snippets Groups Projects
Commit edfd1f89 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

fixes another IE weirdnes when handling list items

Ignore-this: d5a0f9671af3607796332a1afcc8de79

Fixes a problem where list mode couldn't easily be left by removing a bullet.
Hitting enter would readd a bullet always.

note: development was part of the ICKE 2.0 project see
      http://www.icke-projekt.de for info

darcs-hash:20090805123523-6e07b-46570b10a1422d04ad3c7251323568c712037864.gz
parent 8f99c3ec
No related branches found
No related tags found
No related merge requests found
......@@ -196,19 +196,19 @@ function addBtnActionAutohead(btn, props, edid, id)
*
* @author Andreas Gohr <andi@splitbrain.org>
* @fixme handle tabs
* @fixme IE compatibility not tested yet
*/
function keyHandler(e){
if(e.keyCode != 13 &&
e.keyCode != 8 &&
e.keyCode != 32) return; //FIXME IE
e.keyCode != 32) return;
var field = e.target;
var selection = getSelection(field);
var search = "\n"+field.value.substr(0,selection.start);
var linestart = search.lastIndexOf("\n");
var linestart = Math.max(search.lastIndexOf("\n"),
search.lastIndexOf("\r")); //IE workaround
search = search.substr(linestart);
if(e.keyCode == 13){ // Enter //FIXME IE
if(e.keyCode == 13){ // Enter
// keep current indention for lists and code
var match = search.match(/(\n +([\*-] ?)?)/);
if(match){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment