mediawiki-extensions-Relate.../resources/ext.relatedArticles.cards/CardListView.js
Jan Drewniak 191fc2af9d Remove muhogan templates and module
Removes the muhogan module along with the templates and replacing
them with jQuery DOM construction.

Bug: T219846
Change-Id: I246f9c46ea2cc5721ddd57efcf58fae9fd947c58
2019-04-10 17:14:28 +02:00

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;
}() );