Skip to content

Commit

Permalink
Merge branch 'master' of github.com:grafana/grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
torkelo committed Jul 18, 2018
2 parents 913b857 + 3ab5ab3 commit 29291f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/app/containers/Explore/QueryField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { processLabels, RATE_RANGES, cleanText } from './utils/prometheus';
import Typeahead from './Typeahead';

const EMPTY_METRIC = '';
const METRIC_MARK = 'metric';
export const TYPEAHEAD_DEBOUNCE = 300;

function flattenSuggestions(s) {
Expand Down Expand Up @@ -135,7 +136,7 @@ class QueryField extends React.Component<any, any> {
if (!this.state.metrics) {
return;
}
setPrismTokens(this.props.prismLanguage, 'metrics', this.state.metrics);
setPrismTokens(this.props.prismLanguage, METRIC_MARK, this.state.metrics);

// Trigger re-render
window.requestAnimationFrame(() => {
Expand Down Expand Up @@ -184,7 +185,7 @@ class QueryField extends React.Component<any, any> {
let typeaheadContext = null;

// Take first metric as lucky guess
const metricNode = editorNode.querySelector('.metric');
const metricNode = editorNode.querySelector(`.${METRIC_MARK}`);

if (wrapperClasses.contains('context-range')) {
// Rate ranges
Expand Down

0 comments on commit 29291f8

Please sign in to comment.