mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-12 09:09:25 +00:00
Clear cache key when deactivating target
And other state too, while we're at it. Bug: 57905 Change-Id: Ifd2744c841f302764cf57c13f4a760cbe80fa2e0
This commit is contained in:
parent
9dc891f4cb
commit
75449ea597
|
@ -215,6 +215,9 @@ ve.init.mw.ViewPageTarget.prototype.deactivate = function ( override ) {
|
|||
this.loading.abort();
|
||||
}
|
||||
|
||||
this.clearState();
|
||||
this.docToSave = null;
|
||||
|
||||
this.deactivating = false;
|
||||
mw.hook( 've.deactivationComplete' ).fire();
|
||||
}
|
||||
|
|
|
@ -60,20 +60,7 @@ ve.init.mw.Target = function VeInitMwTarget( $container, pageName, revisionId )
|
|||
this.pluginCallbacks = [];
|
||||
this.modulesReady = $.Deferred();
|
||||
this.preparedCacheKeyPromise = null;
|
||||
this.loading = false;
|
||||
this.saving = false;
|
||||
this.diffing = false;
|
||||
this.serializing = false;
|
||||
this.submitting = false;
|
||||
this.baseTimeStamp = null;
|
||||
this.startTimeStamp = null;
|
||||
this.doc = null;
|
||||
this.editNotices = null;
|
||||
this.$checkboxes = null;
|
||||
this.remoteNotices = [];
|
||||
this.localNoticeMessages = [];
|
||||
this.sanityCheckFinished = false;
|
||||
this.sanityCheckVerified = false;
|
||||
this.clearState();
|
||||
this.isMobileDevice = (
|
||||
'ontouchstart' in window ||
|
||||
( window.DocumentTouch && document instanceof window.DocumentTouch )
|
||||
|
@ -744,6 +731,28 @@ ve.init.mw.Target.prototype.load = function ( additionalModules ) {
|
|||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear the state of this target, preparing it to be reactivated later.
|
||||
*/
|
||||
ve.init.mw.Target.prototype.clearState = function () {
|
||||
this.clearPreparedCacheKey();
|
||||
this.loading = false;
|
||||
this.saving = false;
|
||||
this.diffing = false;
|
||||
this.serializing = false;
|
||||
this.submitting = false;
|
||||
this.baseTimeStamp = null;
|
||||
this.startTimeStamp = null;
|
||||
this.doc = null;
|
||||
this.originalHtml = null;
|
||||
this.editNotices = null;
|
||||
this.$checkboxes = null;
|
||||
this.remoteNotices = [];
|
||||
this.localNoticeMessages = [];
|
||||
this.sanityCheckFinished = false;
|
||||
this.sanityCheckVerified = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Serialize the current document and store the result in the serialization cache on the server.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue