Jelajahi Sumber

fix(templating): fixed issue with templated dashboard and error selectOptionsForCurrentValue undefined

Torkel Ödegaard 10 tahun lalu
induk
melakukan
aaae23e9f0
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      public/app/features/templating/templateValuesSrv.js

+ 3 - 3
public/app/features/templating/templateValuesSrv.js

@@ -80,11 +80,11 @@ function (angular, _, kbn) {
 
 
       if (_.isArray(variable.current.value)) {
       if (_.isArray(variable.current.value)) {
         variable.current.text = variable.current.value.join(' + ');
         variable.current.text = variable.current.value.join(' + ');
-        this.selectOptionsForCurrentValue(variable);
+        self.selectOptionsForCurrentValue(variable);
       }
       }
 
 
       templateSrv.updateTemplateData();
       templateSrv.updateTemplateData();
-      return this.updateOptionsInChildVariables(variable);
+      return self.updateOptionsInChildVariables(variable);
     };
     };
 
 
     this.variableUpdated = function(variable) {
     this.variableUpdated = function(variable) {
@@ -148,7 +148,7 @@ function (angular, _, kbn) {
       }
       }
 
 
       if (_.isArray(variable.current.value)) {
       if (_.isArray(variable.current.value)) {
-        this.selectOptionsForCurrentValue(variable);
+        self.selectOptionsForCurrentValue(variable);
       } else {
       } else {
         var currentOption = _.findWhere(variable.options, { text: variable.current.text });
         var currentOption = _.findWhere(variable.options, { text: variable.current.text });
         if (currentOption) {
         if (currentOption) {