Преглед на файлове

dashlist: toggle folders

Daniel Lee преди 8 години
родител
ревизия
121d48ec26
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9 0
      public/app/features/dashboard/dashboard_list_ctrl.ts

+ 9 - 0
public/app/features/dashboard/dashboard_list_ctrl.ts

@@ -34,6 +34,11 @@ export class DashboardListCtrl {
   }
   }
 
 
   initDashboardList(result: any) {
   initDashboardList(result: any) {
+    if (!result) {
+      this.sections = [];
+      return;
+    }
+
     this.sections = result;
     this.sections = result;
 
 
     for (let section of this.sections) {
     for (let section of this.sections) {
@@ -128,6 +133,10 @@ export class DashboardListCtrl {
     });
     });
   }
   }
 
 
+  toggleFolder(section) {
+    return this.searchSrv.toggleFolder(section);
+  }
+
   // getTags() {
   // getTags() {
   //   return this.backendSrv.get('/api/dashboards/tags').then((results) => {
   //   return this.backendSrv.get('/api/dashboards/tags').then((results) => {
   //     this.tags = results;
   //     this.tags = results;