small code cleanup in grafanaGraph

This commit is contained in:
Torkel Ödegaard
2014-04-05 19:22:23 +02:00
parent 24ea23ce83
commit 347f6aed3f
2 changed files with 19 additions and 6 deletions
+16 -5
View File
@@ -52,14 +52,25 @@ function (angular, $, kbn, moment, _) {
}
}
// Function for rendering panel
function render_panel() {
if (!data) { return; }
if (scope.otherPanelInFullscreenMode()) { return; }
if (!setElementHeight()) { return; }
function shouldAbortRender() {
if (!data) {
return true;
}
if ($rootScope.fullscreen && !scope.fullscreen) {
return true;
}
if (!setElementHeight()) { return true; }
if (_.isString(data)) {
render_panel_as_graphite_png(data);
return true;
}
}
// Function for rendering panel
function render_panel() {
if (shouldAbortRender()) {
return;
}