Mitsuhiro Tanda 9 лет назад
Родитель
Сommit
6ef27a87e4
1 измененных файлов с 19 добавлено и 19 удалено
  1. 19 19
      public/app/features/dashboard/dashboard_ctrl.ts

+ 19 - 19
public/app/features/dashboard/dashboard_ctrl.ts

@@ -36,31 +36,31 @@ export class DashboardCtrl {
 
           // init services
           timeSrv.init(dashboard);
-        } catch (err) {
-          $scope.appEvent("alert-error", ['Dashboard init failed', err.message]);
-        }
 
-        // template values service needs to initialize completely before
-        // the rest of the dashboard can load
-        templateValuesSrv.init(dashboard).finally(function() {
-          dynamicDashboardSrv.init(dashboard);
+          // template values service needs to initialize completely before
+          // the rest of the dashboard can load
+          templateValuesSrv.init(dashboard).finally(function() {
+            dynamicDashboardSrv.init(dashboard);
 
-          unsavedChangesSrv.init(dashboard, $scope);
+            unsavedChangesSrv.init(dashboard, $scope);
 
-          $scope.dashboard = dashboard;
-          $scope.dashboardMeta = dashboard.meta;
-          $scope.dashboardViewState = dashboardViewStateSrv.create($scope);
+            $scope.dashboard = dashboard;
+            $scope.dashboardMeta = dashboard.meta;
+            $scope.dashboardViewState = dashboardViewStateSrv.create($scope);
 
-          dashboardKeybindings.shortcuts($scope);
+            dashboardKeybindings.shortcuts($scope);
 
-          $scope.updateSubmenuVisibility();
-          $scope.setWindowTitleAndTheme();
+            $scope.updateSubmenuVisibility();
+            $scope.setWindowTitleAndTheme();
 
-          $scope.appEvent("dashboard-initialized", $scope.dashboard);
-        }).catch(function(err) {
-          if (err.data && err.data.message) { err.message = err.data.message; }
-          $scope.appEvent("alert-error", ['Dashboard init failed', 'Template variables could not be initialized: ' + err.message]);
-        });
+            $scope.appEvent("dashboard-initialized", $scope.dashboard);
+          }).catch(function(err) {
+            if (err.data && err.data.message) { err.message = err.data.message; }
+            $scope.appEvent("alert-error", ['Dashboard init failed', 'Template variables could not be initialized: ' + err.message]);
+          });
+        } catch (err) {
+          $scope.appEvent("alert-error", ['Dashboard init failed', err.message]);
+        }
       };
 
       $scope.templateVariableUpdated = function() {