Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/126881

Change subject: Destroy the VE target after saving
......................................................................

Destroy the VE target after saving

Otherwise, the target and its surface stick around, then if the user
edits again, there are two targets and two surfaces on the page,
one of them will start responding to the other's events, and lots
of weird things happen.

What should really be done is MobileViewTarget should be long-lived
and allow for multiple activations and deactivations, like ViewPageTarget.
Also, a lot of the code in VisualEditorOverlay should really be in
MobileViewTarget and should be deduplicated with code from ViewPageTarget,
right now it's a pile of hacks.

Bug: 64032
Bug: 64034
Change-Id: Ic2a4b5ded429e9b6dce8773dc60b1ff2c0307fee
---
M javascripts/modules/editor/VisualEditorOverlay.js
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/81/126881/1

diff --git a/javascripts/modules/editor/VisualEditorOverlay.js 
b/javascripts/modules/editor/VisualEditorOverlay.js
index 1585df4..011ca8c 100644
--- a/javascripts/modules/editor/VisualEditorOverlay.js
+++ b/javascripts/modules/editor/VisualEditorOverlay.js
@@ -126,6 +126,9 @@
                onSave: function() {
                        this._super();
                        this.clearSpinner();
+                       this.target.destroy();
+                       this.target = null;
+                       this.docToSave = null;
                },
                reportError: function ( msg ) {
                        popup.show( msg, 'toast error' );

-- 
To view, visit https://gerrit.wikimedia.org/r/126881
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2a4b5ded429e9b6dce8773dc60b1ff2c0307fee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Catrope <roan.katt...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to