Kaynağa Gözat

feat(templates): collapse submenu if none visable templates

bergquist 10 yıl önce
ebeveyn
işleme
4299feee37

+ 5 - 1
public/app/features/dashboard/dashboardSrv.js

@@ -140,7 +140,11 @@ function (angular, $, _, moment) {
     };
     };
 
 
     p.isSubmenuFeaturesEnabled = function() {
     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) {
     p.getPanelInfoById = function(panelId) {