mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 18:58:42 +00:00
Merge "Move activating/deactivating to ViewPageTarget"
This commit is contained in:
commit
5cc0706067
|
@ -36,6 +36,8 @@ ve.init.mw.ViewPageTarget = function VeInitMwViewPageTarget() {
|
|||
this.onBeforeUnloadHandler = null;
|
||||
this.timings = {};
|
||||
this.active = false;
|
||||
this.activating = false;
|
||||
this.deactivating = false;
|
||||
this.edited = false;
|
||||
// If this is true then #transformPage / #restorePage will not call pushState
|
||||
// This is to avoid adding a new history entry for the url we just got from onpopstate
|
||||
|
@ -244,6 +246,7 @@ ve.init.mw.ViewPageTarget.prototype.onLoadError = function ( response, status )
|
|||
* @method
|
||||
*/
|
||||
ve.init.mw.ViewPageTarget.prototype.onSurfaceReady = function () {
|
||||
this.activating = false;
|
||||
this.surface.getModel().getDocument().connect( this, {
|
||||
'transact': 'recordLastTransactionTime'
|
||||
} );
|
||||
|
|
|
@ -74,8 +74,6 @@ ve.init.mw.Target = function VeInitMwTarget( $container, pageName, revisionId )
|
|||
this.localNoticeMessages = [];
|
||||
this.sanityCheckFinished = false;
|
||||
this.sanityCheckVerified = false;
|
||||
this.activating = false;
|
||||
this.deactivating = false;
|
||||
this.isMobileDevice = (
|
||||
'ontouchstart' in window ||
|
||||
( window.DocumentTouch && document instanceof window.DocumentTouch )
|
||||
|
@ -322,15 +320,12 @@ ve.init.mw.Target.prototype.onReady = function () {
|
|||
// We need to wait until onReady as local notices may require special messages
|
||||
this.onNoticesReady();
|
||||
this.loading = false;
|
||||
if ( this.activating ) {
|
||||
this.edited = false;
|
||||
this.setUpSurface( this.doc, ve.bind( function() {
|
||||
this.startSanityCheck();
|
||||
this.$document[0].focus();
|
||||
this.activating = false;
|
||||
this.emit( 'surfaceReady' );
|
||||
}, this ) );
|
||||
}
|
||||
this.edited = false;
|
||||
this.setUpSurface( this.doc, ve.bind( function() {
|
||||
this.startSanityCheck();
|
||||
this.$document[0].focus();
|
||||
this.emit( 'surfaceReady' );
|
||||
}, this ) );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue