jenkins-bot has submitted this change and it was merged.
Change subject: Abort activation when changing to view mode.
......................................................................
Abort activation when changing to view mode.
Resolves (Bug 44838)
Changes:
* onLoad: Setup only if activating. Prevents ve from loading after aborted
while activating.
* onViewTabClick: add clause for activating mode. Calls deactivate with an
override, and exits activating mode.
Change-Id: Ia61cd1d576b63098419474ad58bc01362c08541e
---
M modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
1 file changed, 18 insertions(+), 12 deletions(-)
Approvals:
Catrope: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
index d6e7426..1647125 100644
--- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
@@ -296,18 +296,20 @@
* @param {HTMLElement} dom Parsed DOM from server
*/
ve.init.mw.ViewPageTarget.prototype.onLoad = function ( dom ) {
- this.edited = false;
- this.setUpSurface( dom );
- this.setupToolbarEditNotices();
- this.setupToolbarButtons();
- this.setupSaveDialog();
- this.attachToolbarButtons();
- this.attachSaveDialog();
- this.restoreScrollPosition();
- this.restoreEditSection();
- this.setupBeforeUnloadHandler();
- this.$document.focus();
- this.activating = false;
+ if ( this.activating ) {
+ this.edited = false;
+ this.setUpSurface( dom );
+ this.setupToolbarEditNotices();
+ this.setupToolbarButtons();
+ this.setupSaveDialog();
+ this.attachToolbarButtons();
+ this.attachSaveDialog();
+ this.restoreScrollPosition();
+ this.restoreEditSection();
+ this.setupBeforeUnloadHandler();
+ this.$document.focus();
+ this.activating = false;
+ }
};
/**
@@ -485,6 +487,10 @@
this.deactivate();
// Prevent the edit tab's normal behavior
e.preventDefault();
+ } else if ( this.activating ) {
+ this.deactivate( true );
+ this.activating = false;
+ e.preventDefault();
}
};
--
To view, visit https://gerrit.wikimedia.org/r/48491
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia61cd1d576b63098419474ad58bc01362c08541e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Robmoen <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Trevor Parscal <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits