mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-12 09:09:25 +00:00
Merge "Ensure that ve.init.target is correct when re-activating an ArticleTarget"
This commit is contained in:
commit
cb9895e304
|
@ -29,6 +29,13 @@ ve.init.mw.ArticleTarget = function VeInitMwArticleTarget( config ) {
|
|||
// Parent constructor
|
||||
ve.init.mw.ArticleTarget.super.call( this, config );
|
||||
|
||||
// Register
|
||||
if ( config.register !== false ) {
|
||||
// ArticleTargets are never destroyed, but we can't trust ve.init.target to
|
||||
// not get overridden by other targets that may get created on the page.
|
||||
ve.init.articleTarget = this;
|
||||
}
|
||||
|
||||
// Properties
|
||||
this.saveDialog = null;
|
||||
this.saveDeferred = null;
|
||||
|
|
|
@ -404,6 +404,10 @@ ve.init.mw.DesktopArticleTarget.prototype.activate = function ( dataPromise ) {
|
|||
var surface,
|
||||
target = this;
|
||||
|
||||
// We may be re-activating an old target, during which time ve.init.target
|
||||
// has been overridden.
|
||||
ve.init.target = ve.init.articleTarget;
|
||||
|
||||
if ( !this.active && !this.activating ) {
|
||||
this.activating = true;
|
||||
this.activatingDeferred = ve.createDeferred();
|
||||
|
|
Loading…
Reference in a new issue