Skip to content

Commit

Permalink
Fixed Default Background option to support Flip panels
Browse files Browse the repository at this point in the history
  • Loading branch information
PeteBa committed Apr 28, 2017
1 parent ad59951 commit a8a6def
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
7 changes: 4 additions & 3 deletions dist/css/status_panel.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/status_panel.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions dist/status_ctrl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/status_ctrl.js.map

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/css/status_panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@
}

.ok-state {
background-color: green;

.ok-text {
display: block;
}
}

.ok-state:not(.default-background) {
background-color: green;
}

.warn-state {
background-color: orange;
.warning-text {
Expand Down
7 changes: 4 additions & 3 deletions src/status_ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export class StatusPluginCtrl extends MetricsPanelCtrl {
}

handleCssDisplay() {
this.$panelContainer.removeClass('error-state warn-state disabled-state ok-state no-data-state');
this.$panelContainer.removeClass('error-state warn-state disabled-state ok-state no-data-state default-background');

if(this.duplicates) {
this.$panelContainer.addClass('error-state');
Expand All @@ -306,8 +306,9 @@ export class StatusPluginCtrl extends MetricsPanelCtrl {
} else if((this.series == undefined || this.series.length == 0) && this.panel.isGrayOnNoData) {
this.$panelContainer.addClass('no-data-state');
} else {
if (!this.panel.useDefaultBackground)
this.$panelContainer.addClass('ok-state');
this.$panelContainer.addClass('ok-state');
if (this.panel.useDefaultBackground)
this.$panelContainer.addClass('default-background');
}
}

Expand Down

0 comments on commit a8a6def

Please sign in to comment.