mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 03:08:42 +00:00
Move the cursor to the end of newly inserted links
Inserted links happen when the cursor is not near a word, so we insert the target as text Change-Id: I06c2c425d28db7ca61f13c438e25cc9c75f391f4
This commit is contained in:
parent
3a2453b1b2
commit
abdcacd68a
|
@ -154,7 +154,9 @@ ve.ui.LinkInspector.prototype.onClose = function ( remove ) {
|
|||
}
|
||||
if ( insert ) {
|
||||
// Insert default text and select it
|
||||
fragment = fragment.insertContent( target, false ).adjustRange( -target.length );
|
||||
fragment = fragment.insertContent( target, false );
|
||||
// Move cursor to the end of the inserted content
|
||||
selection = new ve.Range( this.initialSelection.start + target.length );
|
||||
}
|
||||
if ( undo ) {
|
||||
// Go back to before we added an annotation in an onInitialize handler
|
||||
|
|
Loading…
Reference in a new issue