mediawiki-skins-MinervaNeue/resources/skins.minerva.scripts/page-issues/overlay/IssueList.js
jdlrobson d29eca2bc8 pageIssuesOverlay is a factory function that returns an Overlay
This experiments with making PageIssuesOverlay an Overlay with
various options.

The appending of children is a little messy and points at a need
to standardise this some way
(see https://phabricator.wikimedia.org/T209647)

TODO:
* Remove the iconString property on PageIssueSummary which is no longer
needed

Bug: T209647
Change-Id: Iadd798a820dca6bbb31edc9a8570b6db7aac237a
2019-01-03 08:31:39 -08:00

31 lines
684 B
JavaScript

( function ( M ) {
var View = M.require( 'mobile.startup' ).View,
IssueNotice = M.require( 'skins.minerva.scripts/IssueNotice' );
/**
* IssueList
* @class IssueList
* @extends View
*
* @param {IssueSummary} issues
*/
function IssueList( issues ) {
this.issues = issues;
View.call( this, { className: 'cleanup' } );
}
OO.mfExtend( IssueList, View, {
tagName: 'ul',
postRender: function () {
View.prototype.postRender.apply( this, arguments );
this.append(
this.issues.map( function ( issue ) {
return new IssueNotice( issue ).$el;
} )
);
}
} );
M.define( 'skins.minerva.scripts/IssueList', IssueList );
}( mw.mobileFrontend ) );