Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/193111
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(-)
git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor
refs/changes/11/193111/1
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: newchange
Gerrit-Change-Id: I98cb8fe9b82f7280032fca6382cad2e5a1cdc0a2
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits