mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-09-23 18:29:15 +00:00
ve-cite: Show $originalRefList even if there are no refs in the model
This original use case at T187495 is for he.wiki, where it is likely that all the references are defined in templates, so the model will always be empty, even though $originalRefList is populated. Change-Id: Ia2785a20bf82ab97466276a57936bc9299e1cabe
This commit is contained in:
parent
d190578c9c
commit
59d900d951
|
@ -186,11 +186,13 @@ ve.ce.MWReferencesListNode.prototype.update = function () {
|
|||
this.$originalRefList = $( ve.copyDomElements( model.getStore().value(
|
||||
model.getElement().originalDomElementsHash
|
||||
), document ) );
|
||||
if ( !nodes || !nodes.indexOrder.length ) {
|
||||
// Check for references in the model. If none are found do a slower check
|
||||
// to see if $originalRefList has any, as they could all be defined in templates.
|
||||
if ( ( nodes && nodes.indexOrder.length ) || this.$originalRefList.find( 'li' ).length ) {
|
||||
this.$element.append( this.$originalRefList );
|
||||
} else {
|
||||
this.$refmsg.text( emptyText );
|
||||
this.$element.append( this.$refmsg );
|
||||
} else {
|
||||
this.$element.append( this.$originalRefList );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue