mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-23 22:45:20 +00:00
[refactor] InternalList isn't state
We've almost finished decoupling, and the last remaining usages of InternalList can be inlined. Change-Id: I0809df9d3c24fdd5fe4c628420d0406e012a3259
This commit is contained in:
parent
4d8cb0d18a
commit
e3398577c1
|
@ -24,8 +24,6 @@ ve.ce.MWReferencesListNode = function VeCeMWReferencesListNode() {
|
||||||
ve.ce.FocusableNode.call( this );
|
ve.ce.FocusableNode.call( this );
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
this.internalList = null;
|
|
||||||
this.listNode = null;
|
|
||||||
this.modified = false;
|
this.modified = false;
|
||||||
|
|
||||||
// DOM changes
|
// DOM changes
|
||||||
|
@ -89,11 +87,11 @@ ve.ce.MWReferencesListNode.prototype.getExtraHighlightClasses = function () {
|
||||||
* Handle setup events.
|
* Handle setup events.
|
||||||
*/
|
*/
|
||||||
ve.ce.MWReferencesListNode.prototype.onSetup = function () {
|
ve.ce.MWReferencesListNode.prototype.onSetup = function () {
|
||||||
this.internalList = this.getModel().getDocument().getInternalList();
|
const internalList = this.getModel().getDocument().getInternalList();
|
||||||
this.listNode = this.internalList.getListNode();
|
const listNode = internalList.getListNode();
|
||||||
|
|
||||||
this.internalList.connect( this, { update: 'onInternalListUpdate' } );
|
internalList.connect( this, { update: 'onInternalListUpdate' } );
|
||||||
this.listNode.connect( this, { update: 'onListNodeUpdate' } );
|
listNode.connect( this, { update: 'onListNodeUpdate' } );
|
||||||
|
|
||||||
// Parent method
|
// Parent method
|
||||||
ve.ce.MWReferencesListNode.super.prototype.onSetup.call( this );
|
ve.ce.MWReferencesListNode.super.prototype.onSetup.call( this );
|
||||||
|
@ -106,15 +104,11 @@ ve.ce.MWReferencesListNode.prototype.onTeardown = function () {
|
||||||
// Parent method
|
// Parent method
|
||||||
ve.ce.MWReferencesListNode.super.prototype.onTeardown.call( this );
|
ve.ce.MWReferencesListNode.super.prototype.onTeardown.call( this );
|
||||||
|
|
||||||
if ( !this.listNode ) {
|
const internalList = this.getModel().getDocument().getInternalList();
|
||||||
return;
|
const listNode = internalList.getListNode();
|
||||||
}
|
|
||||||
|
|
||||||
this.internalList.disconnect( this, { update: 'onInternalListUpdate' } );
|
internalList.disconnect( this, { update: 'onInternalListUpdate' } );
|
||||||
this.listNode.disconnect( this, { update: 'onListNodeUpdate' } );
|
listNode.disconnect( this, { update: 'onListNodeUpdate' } );
|
||||||
|
|
||||||
this.internalList = null;
|
|
||||||
this.listNode = null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue