Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/98747
Change subject: Move activating/deactivating to ViewPageTarget
......................................................................
Move activating/deactivating to ViewPageTarget
That's where they belong IMO, since ViewPageTarget is the one that
has .activate() and .deactivate(), and mw.Target doesn't retain any
state (apart from some caching things).
Change-Id: Ia6cf5bac9054163d54ab492d691d8ce9d6a3bb90
---
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
M modules/ve-mw/init/ve.init.mw.Target.js
2 files changed, 9 insertions(+), 11 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/47/98747/1
diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index 307dc1b..4af11f6 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -36,6 +36,8 @@
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 @@
* @method
*/
ve.init.mw.ViewPageTarget.prototype.onSurfaceReady = function () {
+ this.activating = false;
this.surface.getModel().getDocument().connect( this, {
'transact': 'recordLastTransactionTime'
} );
diff --git a/modules/ve-mw/init/ve.init.mw.Target.js
b/modules/ve-mw/init/ve.init.mw.Target.js
index fcaaaf6..543a756 100644
--- a/modules/ve-mw/init/ve.init.mw.Target.js
+++ b/modules/ve-mw/init/ve.init.mw.Target.js
@@ -74,8 +74,6 @@
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 @@
// 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 ) );
};
/**
--
To view, visit https://gerrit.wikimedia.org/r/98747
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6cf5bac9054163d54ab492d691d8ce9d6a3bb90
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits