浏览代码

wip: panel-header: Fix shareModal compatibility with react and angular

Johannes Schill 7 年之前
父节点
当前提交
08251425ca
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      public/app/features/dashboard/shareModalCtrl.ts

+ 2 - 2
public/app/features/dashboard/shareModalCtrl.ts

@@ -12,8 +12,8 @@ export function ShareModalCtrl($scope, $rootScope, $location, $timeout, timeSrv,
   $scope.editor = { index: $scope.tabIndex || 0 };
 
   $scope.init = () => {
-    $scope.panel = $scope.model.panel || $scope.panel; // React pass panel and dashboard in the "model" property
-    $scope.dashboard = $scope.model.dashboard || $scope.dashboard;
+    $scope.panel = $scope.model && $scope.model.panel ? $scope.model.panel : $scope.panel; // React pass panel and dashboard in the "model" property
+    $scope.dashboard = $scope.model && $scope.model.dashboard ? $scope.model.dashboard : $scope.dashboard; // ^
     $scope.modeSharePanel = $scope.panel ? true : false;
 
     $scope.tabs = [{ title: 'Link', src: 'shareLink.html' }];