From 977123be3627c8fedced0d97b1e34434bb30f7a4 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 20 Dec 2012 13:26:28 -0800 Subject: [PATCH] UI sections: Support per-section pre-filter In addition to the main sectionPreFilter in the cloudStack UI, allow a per-section 'preFilter' which is called if the navigation section is not returned in sectionPreFilter. This is used primarily to support plugin sections which will not be displayed by default. --- ui/scripts/ui/core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/scripts/ui/core.js b/ui/scripts/ui/core.js index c38ed3f6e75..30cd75be180 100644 --- a/ui/scripts/ui/core.js +++ b/ui/scripts/ui/core.js @@ -40,7 +40,9 @@ $.each(args.sections, function(sectionID, args) { if (preFilter && $.inArray(sectionID, preFilter) == -1) { - return true; + if (!(args.preFilter && args.preFilter())) { + return true; + } } var $li = $('
  • ')