Fixed a Chrome/Safari bug in which ending a link didn't always work.
Specifically, in a list of two elements in which each element was a link, clicking right after the first element and then pressing ctrl-L to end the link didn't work as expected. Now it does.
This commit is contained in:
parent
bf4bf4026e
commit
cfdd666c5f
2
NEWS
2
NEWS
|
@ -1,5 +1,5 @@
|
|||
1.5.9:
|
||||
*
|
||||
* Fixed a Chrome/Safari bug in which ending a link didn't always work.
|
||||
|
||||
1.5.8: November 24, 2008
|
||||
* Fixed a bug that prevented notes from being automatically saved in certain
|
||||
|
|
|
@ -602,7 +602,9 @@ Editor.prototype.end_link = function () {
|
|||
// end of the link if it's not already there
|
||||
if ( link && WEBKIT ) {
|
||||
var selection = this.iframe.contentWindow.getSelection();
|
||||
selection.collapse( link, 1 );
|
||||
var sentinel = this.document.createTextNode( Editor.title_placeholder_char );
|
||||
insertSiblingNodesAfter( link, sentinel );
|
||||
selection.collapse( sentinel, 1 );
|
||||
}
|
||||
} else if ( this.document.selection ) { // browsers such as IE
|
||||
// if some text is already selected, unlink it and bail
|
||||
|
|
Reference in New Issue