Merge "ve.ui.MWMagicLinkNodeInspector: Select annotation after converting"

This commit is contained in:
jenkins-bot 2019-04-16 16:17:48 +00:00 committed by Gerrit Code Review
commit 68830e2879

View file

@ -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(