MWNoticesPopupTool: When setting notices, clear existing notices

This would keep on duplicating notices when switching modes.

Change-Id: I04720904eddd95c0d3618d284d1930e41a0ae137
This commit is contained in:
David Lynch 2017-03-16 12:13:36 -05:00
parent cf94956fba
commit 318c6718fd

View file

@ -78,6 +78,10 @@ ve.ui.MWNoticesPopupTool.prototype.setNotices = function ( notices ) {
mw.language.convertNumber( count )
) );
if ( this.$items ) {
this.$items.remove();
}
this.$items = $( '<div>' ).addClass( 've-ui-mwNoticesPopupTool-items' );
notices.forEach( function ( itemHtml ) {