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

This commit is contained in:
Torkel Ödegaard 2014-02-05 15:26:34 +01:00
parent 73c5883f0d
commit df54c17dca
2 changed files with 6 additions and 8 deletions

View File

@ -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) { if (scope.otherPanelInFullscreenMode()) { return; }
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 (scope.otherPanelInFullscreenMode()) { return; }
if ($rootScope.fullscreen && !scope.fullscreen) {
return;
}
if (!setElementHeight()) { return; } if (!setElementHeight()) { return; }
if (_.isString(data)) { if (_.isString(data)) {

View File

@ -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);
}; };