Follow-up I3412c53cc: Fix reference to target in ve.ce.MWWikitextSurface

Bug: T329439
Change-Id: I67632bf62c0373e7825ccd9fbe263116928e7e35
(cherry picked from commit 12395b0a57)
This commit is contained in:
Ed Sanders 2023-02-12 11:13:48 +00:00 committed by Bartosz Dziewoński
parent d8fd73d72a
commit b24709e3d2

View file

@ -113,7 +113,7 @@ ve.ce.MWWikitextSurface.prototype.afterPasteInsertExternalData = function ( targ
// isPlainText is true but we still need sanitize (e.g. remove lists)
var promise = ve.ce.MWWikitextSurface.super.prototype.afterPasteInsertExternalData.call( this, targetFragment, plainPastedDocumentModel, plainContextRange );
if ( this.getTarget().constructor.static.convertToWikitextOnPaste && !wasPlain ) {
if ( this.getSurface().getTarget().constructor.static.convertToWikitextOnPaste && !wasPlain ) {
promise.then( function () {
// We need to wait for the selection change after paste as that triggers
// a contextChange event. Really we should wait for the afterPaste promise to resolve.
@ -123,7 +123,7 @@ ve.ce.MWWikitextSurface.prototype.afterPasteInsertExternalData = function ( targ
// HACK: Directly set the 'relatedSources' result in the context to trick it
// into showing a context at the end of the paste. This context will disappear
// as soon as the selection change as a contextChange will fire.
// TODO: Come up witha method to store this context on the surface model then
// TODO: Come up with a method to store this context on the surface model then
// have the LinearContext read it from there.
context.relatedSources = [ {
embeddable: false,