From 4299feee3799402119972083696194f7ab6984cc Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 29 Feb 2016 10:49:11 +0100 Subject: [PATCH] feat(templates): collapse submenu if none visable templates --- public/app/features/dashboard/dashboardSrv.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/dashboardSrv.js b/public/app/features/dashboard/dashboardSrv.js index be404dd1ce1..01c5787481b 100644 --- a/public/app/features/dashboard/dashboardSrv.js +++ b/public/app/features/dashboard/dashboardSrv.js @@ -140,7 +140,11 @@ function (angular, $, _, moment) { }; p.isSubmenuFeaturesEnabled = function() { - return this.templating.list.length > 0 || this.annotations.list.length > 0 || this.links.length > 0; + var visableTemplates = _.filter(this.templating.list, function(template) { + return template.hideVariable === undefined || template.hideVariable === false; + }); + + return visableTemplates.length > 0 || this.annotations.list.length > 0 || this.links.length > 0; }; p.getPanelInfoById = function(panelId) {