mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 08:20:02 +00:00
Also count sub-ref re-uses when getting total usages
Bug: T373023 Change-Id: I12a37be8a1e26d25b152eb929f41188675e35038
This commit is contained in:
parent
e4e6b59306
commit
76aa5d9cb4
|
@ -217,7 +217,11 @@ ve.dm.MWGroupReferences.prototype.getTotalUsageCount = function ( listKey ) {
|
|||
const mainRefsCount = mainRefs.length;
|
||||
|
||||
const subrefs = this.getSubrefs( listKey );
|
||||
const subrefsCount = subrefs.length;
|
||||
|
||||
let subrefsCount = 0;
|
||||
subrefs.forEach( ( node ) => {
|
||||
subrefsCount += this.getRefUsages( node.getAttribute( 'listKey' ) ).length;
|
||||
} );
|
||||
|
||||
const totalUsageCount = mainRefsCount + subrefsCount;
|
||||
|
||||
|
@ -226,7 +230,7 @@ ve.dm.MWGroupReferences.prototype.getTotalUsageCount = function ( listKey ) {
|
|||
|
||||
/**
|
||||
* @param {string} parentKey parent ref key
|
||||
* @return {ve.dm.MWReferenceNode[]} List of subrefs for this parent
|
||||
* @return {ve.dm.MWReferenceNode[]} List of subrefs for this parent not including re-uses
|
||||
*/
|
||||
ve.dm.MWGroupReferences.prototype.getSubrefs = function ( parentKey ) {
|
||||
return this.subRefsByParent[ parentKey ] || [];
|
||||
|
|
Loading…
Reference in a new issue