diff --git a/public/app/core/components/grafana_app.ts b/public/app/core/components/grafana_app.ts index 5a677094754..f910e124a49 100644 --- a/public/app/core/components/grafana_app.ts +++ b/public/app/core/components/grafana_app.ts @@ -192,7 +192,7 @@ export function grafanaAppDirective(playlistSrv, contextSrv) { // hide search if (body.find('.search-container').length > 0) { - if (target.parents('.search-container').length === 0) { + if (target.parents('.search-results-container').length === 0) { scope.$apply(function() { scope.appEvent('hide-dash-search'); }); diff --git a/public/app/plugins/datasource/cloudwatch/datasource.js b/public/app/plugins/datasource/cloudwatch/datasource.js index d4c4188d105..a4d03cd8151 100644 --- a/public/app/plugins/datasource/cloudwatch/datasource.js +++ b/public/app/plugins/datasource/cloudwatch/datasource.js @@ -219,12 +219,12 @@ function (angular, _, moment, dateMath, kbn, templatingVariable, CloudWatchAnnot var metricNameQuery = query.match(/^metrics\(([^\)]+?)(,\s?([^,]+?))?\)/); if (metricNameQuery) { - return this.getMetrics(metricNameQuery[1], metricNameQuery[3]); + return this.getMetrics(templateSrv.replace(metricNameQuery[1]), templateSrv.replace(metricNameQuery[3])); } var dimensionKeysQuery = query.match(/^dimension_keys\(([^\)]+?)(,\s?([^,]+?))?\)/); if (dimensionKeysQuery) { - return this.getDimensionKeys(dimensionKeysQuery[1], dimensionKeysQuery[3]); + return this.getDimensionKeys(templateSrv.replace(dimensionKeysQuery[1]), templateSrv.replace(dimensionKeysQuery[3])); } var dimensionValuesQuery = query.match(/^dimension_values\(([^,]+?),\s?([^,]+?),\s?([^,]+?),\s?([^,]+?)\)/);