mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-12-18 11:00:58 +00:00
191fc2af9d
Removes the muhogan module along with the templates and replacing them with jQuery DOM construction. Bug: T219846 Change-Id: I246f9c46ea2cc5721ddd57efcf58fae9fd947c58
33 lines
735 B
JavaScript
33 lines
735 B
JavaScript
( function () {
|
|
'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 );
|
|
|
|
mw.cards.CardListView = CardListView;
|
|
}() );
|