jenkins-bot has submitted this change and it was merged.

Change subject: Remove unnecessary disconnect in surface destroy
......................................................................


Remove unnecessary disconnect in surface destroy

We no longer attach any events to the dialog manager, however
we do use this in MobileSurface, so add disconnects there.

Change-Id: I98cb8fe9b82f7280032fca6382cad2e5a1cdc0a2
---
M src/ui/ve.ui.MobileSurface.js
M src/ui/ve.ui.Surface.js
2 files changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Trevor Parscal: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/ui/ve.ui.MobileSurface.js b/src/ui/ve.ui.MobileSurface.js
index 836d98a..b71f168 100644
--- a/src/ui/ve.ui.MobileSurface.js
+++ b/src/ui/ve.ui.MobileSurface.js
@@ -85,7 +85,7 @@
 /**
  * Show or hide global overlay.
  *
- * @param {boolean} show If true, show global overlay, otherwise hide it.
+ * @param {boolean} show Show the global overlay.
  */
 ve.ui.MobileSurface.prototype.toggleGlobalOverlay = function ( show ) {
        var $body = $( 'body' );
@@ -108,6 +108,10 @@
  * @inheritdoc
  */
 ve.ui.MobileSurface.prototype.destroy = function () {
+       // Disconnect events
+       this.dialogs.disconnect( this );
+       this.context.getInspectors().disconnect( this );
+
        // Parent method
        ve.ui.MobileSurface.super.prototype.destroy.call( this );
 
diff --git a/src/ui/ve.ui.Surface.js b/src/ui/ve.ui.Surface.js
index 66037e9..1c4ffd9 100644
--- a/src/ui/ve.ui.Surface.js
+++ b/src/ui/ve.ui.Surface.js
@@ -103,9 +103,6 @@
        // Stop periodic history tracking in model
        this.model.stopHistoryTracking();
 
-       // Disconnect events
-       this.dialogs.disconnect( this );
-
        // Destroy the ce.Surface, the ui.Context and window managers
        this.view.destroy();
        this.context.destroy();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I98cb8fe9b82f7280032fca6382cad2e5a1cdc0a2
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[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

Reply via email to