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

Change subject: Deprecate 'live' event in favor of 'setup' and 'teardown' in MW
......................................................................


Deprecate 'live' event in favor of 'setup' and 'teardown' in MW

See also Ieddbf5c684eb0edc3130034de64eb284aeaebbda

Bug: 55505
Change-Id: Ib48ef4f62ac53d41abb69f275f51da3d8b85ce0e
---
M modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js
1 file changed, 13 insertions(+), 8 deletions(-)

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



diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js 
b/modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js
index b4e1c63..cff126e 100644
--- a/modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js
+++ b/modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js
@@ -31,7 +31,8 @@
        this.internalList = this.model.getDocument().internalList;
 
        // Events
-       this.connect( this, { 'live': 'onLive' } );
+       this.connect( this, { 'setup': 'onSetup' } );
+       this.connect( this, { 'teardown': 'onTeardown' } );
 
        // Initialization
        this.update();
@@ -54,17 +55,21 @@
 /* Methods */
 
 /**
- * Handle live events.
+ * Handle setup event.
  * @method
  */
-ve.ce.MWReferenceNode.prototype.onLive = function () {
+ve.ce.MWReferenceNode.prototype.onSetup = function () {
+       this.internalList.connect( this, { 'update': 'onInternalListUpdate' } );
+};
+
+/**
+ * Handle teardown event.
+ * @method
+ */
+ve.ce.MWReferenceNode.prototype.onTeardown = function () {
        // As we are listening to the internal list, we need to make sure
        // we remove the listeners when this object is removed from the document
-       if ( this.live ) {
-               this.internalList.connect( this, { 'update': 
'onInternalListUpdate' } );
-       } else {
-               this.internalList.disconnect( this );
-       }
+       this.internalList.disconnect( this );
 };
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib48ef4f62ac53d41abb69f275f51da3d8b85ce0e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to