From cecbea8148cce64e8b969ff036cdb0edad318c63 Mon Sep 17 00:00:00 2001 From: abuyoyo Date: Tue, 2 Aug 2022 01:53:52 +0300 Subject: [PATCH] plugin_count - do not count hidden notices --- js/notice_manager_panel.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/notice_manager_panel.js b/js/notice_manager_panel.js index 9f151ae..78ca285 100644 --- a/js/notice_manager_panel.js +++ b/js/notice_manager_panel.js @@ -150,9 +150,9 @@ var NoticeManager = (function ($, document) { getNotices: () => notices, getNoticesTopPriority: () => { - if ( notices.filter( selectors_error.join(", ") ).length ) + if (notices.filter(":visible").filter(selectors_error.join(", ")).length) return 'error'; - if ( notices.filter( selectors_warning.join(", ") ).length ) + if (notices.filter(":visible").filter(selectors_warning.join(", ")).length) return 'warning'; return 'notice'; }, @@ -186,7 +186,7 @@ var NoticeManager = (function ($, document) { addCounter: () => { if (!button.children('.plugin-count').length){ button.append( - $("").text(notices.length).attr({ + $("").text(notices.filter(":visible").length).attr({ class: "plugin-count", }).addClass(NoticeManager.getNoticesTopPriority()) );