mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-12-19 11:30:44 +00:00
df1ff38877
1) Merge ext.relatedArticles.readMore and ext.relatedArticles.cards modules These are always loaded together. No need to have them in separate modules. In process switch to packagefiles 2) Merge ext.relatedArticles.readMore.bootstrap and ext.relatedArticles.readMore.gateway Always loaded together. Bug: T306228 Change-Id: I9442b0336e22ca795cc06f76068215266fe81271
31 lines
680 B
JavaScript
31 lines
680 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* View that renders multiple {@link mw.cards.CardView cards}
|
|
*
|
|
* @class mw.cards.CardListView
|
|
* @param {mw.cards.CardView[]} cardViews
|
|
*/
|
|
function CardListView( cardViews ) {
|
|
var self = this;
|
|
|
|
/**
|
|
* @property {mw.cards.CardView[]|Array}
|
|
*/
|
|
this.cardViews = cardViews || [];
|
|
|
|
/**
|
|
* @property {jQuery}
|
|
*/
|
|
this.$el = $( '<ul>' ).attr( { class: 'ext-related-articles-card-list' } );
|
|
|
|
// We don't want to use template partials because we want to
|
|
// preserve event handlers of each card view.
|
|
this.cardViews.forEach( function ( cardView ) {
|
|
self.$el.append( cardView.$el );
|
|
} );
|
|
}
|
|
OO.initClass( CardListView );
|
|
|
|
module.exports = CardListView;
|