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,16 +147,9 @@ ve.ui.MWLinkAnnotationInspector.prototype.onLinkTypeSelectSelect = function () {
|
||||||
this.annotationInput = this.createAnnotationInput();
|
this.annotationInput = this.createAnnotationInput();
|
||||||
this.form.$element.append( this.annotationInput.$element );
|
this.form.$element.append( this.annotationInput.$element );
|
||||||
|
|
||||||
if ( isExternal ) {
|
// If the user manually switches to internal links with an external link in the input, remember this
|
||||||
// If the user switches to external links clear the input, unless the input is URL-like
|
if ( !isExternal && inputHasProtocol ) {
|
||||||
if ( !inputHasProtocol ) {
|
this.allowProtocolInInternal = true;
|
||||||
text = '';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// If the user manually switches to internal links with an external link in the input, remember this
|
|
||||||
if ( inputHasProtocol ) {
|
|
||||||
this.allowProtocolInInternal = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.annotationInput.text.setValue( text ).focus();
|
this.annotationInput.text.setValue( text ).focus();
|
||||||
|
|
Loading…
Reference in a new issue