mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 23:05:35 +00:00
Merge "Clear cache key when deactivating target"
This commit is contained in:
commit
9c3610afb3
|
@ -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