소스 검색

small refactoring of check if other panel is in fullscreen edit/view mode

Torkel Ödegaard 12 년 전
부모
커밋
df54c17dca
2개의 변경된 파일6개의 추가작업 그리고 8개의 파일을 삭제
  1. 2 8
      src/app/directives/grafanaGraph.js
  2. 4 0
      src/app/panels/graphite/module.js

+ 2 - 8
src/app/directives/grafanaGraph.js

@@ -19,9 +19,7 @@ function (angular, $, kbn, moment, _) {
         var hiddenData = {};
 
         scope.$on('refresh',function() {
-          if ($rootScope.fullscreen && !scope.fullscreen) {
-            return;
-          }
+          if (scope.otherPanelInFullscreenMode()) { return; }
 
           scope.get_data();
         });
@@ -58,11 +56,7 @@ function (angular, $, kbn, moment, _) {
         // Function for rendering panel
         function render_panel() {
           if (!data) { return; }
-
-          if ($rootScope.fullscreen && !scope.fullscreen) {
-            return;
-          }
-
+          if (scope.otherPanelInFullscreenMode()) { return; }
           if (!setElementHeight()) { return; }
 
           if (_.isString(data)) {

+ 4 - 0
src/app/panels/graphite/module.js

@@ -370,6 +370,10 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
       $scope.enterFullscreenMode({edit: true});
     };
 
+    $scope.otherPanelInFullscreenMode = function() {
+      return $rootScope.fullscreen && !$scope.fullscreen;
+    };
+
     $scope.render = function(data) {
       $scope.$emit('render', data);
     };