mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
Merge "Always preserve input when switch between internal/external links"
This commit is contained in:
commit
8bee18d802
|
@ -147,17 +147,10 @@ ve.ui.MWLinkAnnotationInspector.prototype.onLinkTypeSelectSelect = function () {
|
|||
this.annotationInput = this.createAnnotationInput();
|
||||
this.form.$element.append( this.annotationInput.$element );
|
||||
|
||||
if ( isExternal ) {
|
||||
// If the user switches to external links clear the input, unless the input is URL-like
|
||||
if ( !inputHasProtocol ) {
|
||||
text = '';
|
||||
}
|
||||
} else {
|
||||
// If the user manually switches to internal links with an external link in the input, remember this
|
||||
if ( inputHasProtocol ) {
|
||||
if ( !isExternal && inputHasProtocol ) {
|
||||
this.allowProtocolInInternal = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.annotationInput.text.setValue( text ).focus();
|
||||
|
||||
|
|
Loading…
Reference in a new issue