mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 14:06:52 +00:00
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:
parent
d8fd73d72a
commit
b24709e3d2
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue