mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TimeRegions: Fixed issue with time regions and tresholds due to angular js upgrade (#29229)
This commit is contained in:
parent
32d4c8c6bc
commit
993adb72e0
@ -7,14 +7,16 @@ export class ThresholdFormCtrl {
|
|||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor($scope: any) {
|
constructor(private $scope: any) {}
|
||||||
|
|
||||||
|
$onInit() {
|
||||||
this.panel = this.panelCtrl.panel;
|
this.panel = this.panelCtrl.panel;
|
||||||
|
|
||||||
if (this.panel.alert) {
|
if (this.panel.alert) {
|
||||||
this.disabled = true;
|
this.disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const unbindDestroy = $scope.$on('$destroy', () => {
|
const unbindDestroy = this.$scope.$on('$destroy', () => {
|
||||||
this.panelCtrl.editingThresholds = false;
|
this.panelCtrl.editingThresholds = false;
|
||||||
this.panelCtrl.render();
|
this.panelCtrl.render();
|
||||||
unbindDestroy();
|
unbindDestroy();
|
||||||
|
@ -8,10 +8,12 @@ export class TimeRegionFormCtrl {
|
|||||||
colorModes: any;
|
colorModes: any;
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor($scope: any) {
|
constructor(private $scope: any) {}
|
||||||
|
|
||||||
|
$onInit() {
|
||||||
this.panel = this.panelCtrl.panel;
|
this.panel = this.panelCtrl.panel;
|
||||||
|
|
||||||
const unbindDestroy = $scope.$on('$destroy', () => {
|
const unbindDestroy = this.$scope.$on('$destroy', () => {
|
||||||
this.panelCtrl.editingTimeRegions = false;
|
this.panelCtrl.editingTimeRegions = false;
|
||||||
this.panelCtrl.render();
|
this.panelCtrl.render();
|
||||||
unbindDestroy();
|
unbindDestroy();
|
||||||
|
Loading…
Reference in New Issue
Block a user