witten
/
luminotes
Archived
1
0
Fork 0

Backspacing at the end of a link in IE no longer ends the link.

Fixed a bug where typing a space within a link in IE caused the space to be added to the end of the link.
This commit is contained in:
Dan Helfman 2008-06-29 15:19:59 -07:00
parent 7e9a5171f3
commit 94647c4887
2 changed files with 10 additions and 2 deletions

3
NEWS
View File

@ -1,5 +1,8 @@
1.4.10: June ?, 2008:
* New suggest-as-you-type feature for creating links.
* Fixed a bug where typing a space within a link in IE caused the space
to be added to the end of the link.
* Backspacing at the end of a link in IE no longer ends the link.
1.4.9: June 25, 2008:
* When linking to a note by title, the note resolution is now

View File

@ -995,10 +995,15 @@ Wiki.prototype.editor_key_pressed = function ( editor, event ) {
} else if ( ( code == 32 || code == 9 ) && editor.document.selection && editor.state_enabled( "a" ) ) {
if ( code == 32 ) {
var range = editor.document.selection.createRange();
var text = range.parentElement().firstChild;
text.nodeValue += " ";
range.text = " ";
}
event.stop();
// IE: hitting backspace while making a link shouldn't end the link
} else if ( code == 8 && editor.document.selection && editor.state_enabled( "a" ) ) {
var range = editor.document.selection.createRange();
range.moveStart( "character", -1 );
range.text = "";
event.stop();
}
}