From 318c6718fdff861d78e70a3b9bedfad98bec6c02 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Thu, 16 Mar 2017 12:13:36 -0500 Subject: [PATCH] MWNoticesPopupTool: When setting notices, clear existing notices This would keep on duplicating notices when switching modes. Change-Id: I04720904eddd95c0d3618d284d1930e41a0ae137 --- modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js b/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js index 9cfec0cafd..b0dbef1bfa 100644 --- a/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js +++ b/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js @@ -78,6 +78,10 @@ ve.ui.MWNoticesPopupTool.prototype.setNotices = function ( notices ) { mw.language.convertNumber( count ) ) ); + if ( this.$items ) { + this.$items.remove(); + } + this.$items = $( '
' ).addClass( 've-ui-mwNoticesPopupTool-items' ); notices.forEach( function ( itemHtml ) {