Merge "Move activating/deactivating to ViewPageTarget"

This commit is contained in:
jenkins-bot 2013-12-03 18:21:55 +00:00 committed by Gerrit Code Review
commit 5cc0706067
2 changed files with 9 additions and 11 deletions

View file

@ -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'
} );

View file

@ -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 ) );
};
/**