mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "ve.ui.MWMagicLinkNodeInspector: Select annotation after converting"
This commit is contained in:
commit
68830e2879
|
@ -142,6 +142,7 @@ ve.ui.MWMagicLinkNodeInspector.prototype.getTeardownProcess = function ( data )
|
||||||
return ve.ui.MWMagicLinkNodeInspector.super.prototype.getTeardownProcess.call( this, data )
|
return ve.ui.MWMagicLinkNodeInspector.super.prototype.getTeardownProcess.call( this, data )
|
||||||
.first( function () {
|
.first( function () {
|
||||||
var content, annotation, annotations,
|
var content, annotation, annotations,
|
||||||
|
surfaceView = this.manager.getSurface().getView(),
|
||||||
surfaceModel = this.getFragment().getSurface(),
|
surfaceModel = this.getFragment().getSurface(),
|
||||||
doc = surfaceModel.getDocument(),
|
doc = surfaceModel.getDocument(),
|
||||||
nodeRange = this.selectedNode.getOuterRange(),
|
nodeRange = this.selectedNode.getOuterRange(),
|
||||||
|
@ -166,6 +167,11 @@ ve.ui.MWMagicLinkNodeInspector.prototype.getTeardownProcess = function ( data )
|
||||||
surfaceModel.change(
|
surfaceModel.change(
|
||||||
ve.dm.TransactionBuilder.static.newFromReplacement( doc, nodeRange, content )
|
ve.dm.TransactionBuilder.static.newFromReplacement( doc, nodeRange, content )
|
||||||
);
|
);
|
||||||
|
setTimeout( function () {
|
||||||
|
surfaceView.selectAnnotation( function ( view ) {
|
||||||
|
return view.model instanceof ve.dm.LinkAnnotation;
|
||||||
|
} );
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
} else if ( done && this.validate( value ) ) {
|
} else if ( done && this.validate( value ) ) {
|
||||||
surfaceModel.change(
|
surfaceModel.change(
|
||||||
|
|
Loading…
Reference in a new issue