Jelajahi Sumber

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

Torkel Ödegaard 12 tahun lalu
induk
melakukan
df54c17dca
2 mengubah file dengan 6 tambahan dan 8 penghapusan
  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 = {};
         var hiddenData = {};
 
 
         scope.$on('refresh',function() {
         scope.$on('refresh',function() {
-          if ($rootScope.fullscreen && !scope.fullscreen) {
-            return;
-          }
+          if (scope.otherPanelInFullscreenMode()) { return; }
 
 
           scope.get_data();
           scope.get_data();
         });
         });
@@ -58,11 +56,7 @@ function (angular, $, kbn, moment, _) {
         // Function for rendering panel
         // Function for rendering panel
         function render_panel() {
         function render_panel() {
           if (!data) { return; }
           if (!data) { return; }
-
-          if ($rootScope.fullscreen && !scope.fullscreen) {
-            return;
-          }
-
+          if (scope.otherPanelInFullscreenMode()) { return; }
           if (!setElementHeight()) { return; }
           if (!setElementHeight()) { return; }
 
 
           if (_.isString(data)) {
           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.enterFullscreenMode({edit: true});
     };
     };
 
 
+    $scope.otherPanelInFullscreenMode = function() {
+      return $rootScope.fullscreen && !$scope.fullscreen;
+    };
+
     $scope.render = function(data) {
     $scope.render = function(data) {
       $scope.$emit('render', data);
       $scope.$emit('render', data);
     };
     };