mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 08:20:02 +00:00
Merge "[refactor] InternalList isn't state"
This commit is contained in:
commit
30b5fca6ee
|
@ -24,8 +24,6 @@ ve.ce.MWReferencesListNode = function VeCeMWReferencesListNode() {
|
|||
ve.ce.FocusableNode.call( this );
|
||||
|
||||
// Properties
|
||||
this.internalList = null;
|
||||
this.listNode = null;
|
||||
this.modified = false;
|
||||
|
||||
// DOM changes
|
||||
|
@ -89,11 +87,11 @@ ve.ce.MWReferencesListNode.prototype.getExtraHighlightClasses = function () {
|
|||
* Handle setup events.
|
||||
*/
|
||||
ve.ce.MWReferencesListNode.prototype.onSetup = function () {
|
||||
this.internalList = this.getModel().getDocument().getInternalList();
|
||||
this.listNode = this.internalList.getListNode();
|
||||
const internalList = this.getModel().getDocument().getInternalList();
|
||||
const listNode = internalList.getListNode();
|
||||
|
||||
this.internalList.connect( this, { update: 'onInternalListUpdate' } );
|
||||
this.listNode.connect( this, { update: 'onListNodeUpdate' } );
|
||||
internalList.connect( this, { update: 'onInternalListUpdate' } );
|
||||
listNode.connect( this, { update: 'onListNodeUpdate' } );
|
||||
|
||||
// Parent method
|
||||
ve.ce.MWReferencesListNode.super.prototype.onSetup.call( this );
|
||||
|
@ -106,15 +104,11 @@ ve.ce.MWReferencesListNode.prototype.onTeardown = function () {
|
|||
// Parent method
|
||||
ve.ce.MWReferencesListNode.super.prototype.onTeardown.call( this );
|
||||
|
||||
if ( !this.listNode ) {
|
||||
return;
|
||||
}
|
||||
const internalList = this.getModel().getDocument().getInternalList();
|
||||
const listNode = internalList.getListNode();
|
||||
|
||||
this.internalList.disconnect( this, { update: 'onInternalListUpdate' } );
|
||||
this.listNode.disconnect( this, { update: 'onListNodeUpdate' } );
|
||||
|
||||
this.internalList = null;
|
||||
this.listNode = null;
|
||||
internalList.disconnect( this, { update: 'onInternalListUpdate' } );
|
||||
listNode.disconnect( this, { update: 'onListNodeUpdate' } );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue