From eabafb460fd6cf07348fb98a77d6718a7f7f265f Mon Sep 17 00:00:00 2001 From: abuoyoyo Date: Sat, 16 Jul 2022 22:30:41 +0300 Subject: [PATCH] js - NoticeManager.getNoticesTopPriority() --- js/notice_manager_panel.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/notice_manager_panel.js b/js/notice_manager_panel.js index 00ac49a..3198b1a 100644 --- a/js/notice_manager_panel.js +++ b/js/notice_manager_panel.js @@ -123,6 +123,14 @@ var NoticeManager = (function ($, document) { return { getNotices: () => notices, + getNoticesTopPriority: () => { + if ( notices.filter('.error').length ) + return 'error'; + if ( notices.filter('.notice-warning, .update-nag').length ) + return 'warning'; + return 'notice'; + }, + /** * Collect notices into panel. * Remove dismiss-notices button.