diff --git a/public/app/features/dashboard/panel_editor/QueryEditorRow.tsx b/public/app/features/dashboard/panel_editor/QueryEditorRow.tsx index a5ecd978076..ce4cbc4cc4d 100644 --- a/public/app/features/dashboard/panel_editor/QueryEditorRow.tsx +++ b/public/app/features/dashboard/panel_editor/QueryEditorRow.tsx @@ -83,7 +83,7 @@ export class QueryEditorRow extends PureComponent { this.setState({ datasource, loadedDataSourceValue: this.props.dataSourceValue, - hasTextEditMode: false, + hasTextEditMode: _.has(datasource, 'components.QueryCtrl.prototype.toggleEditorMode'), }); } @@ -122,14 +122,8 @@ export class QueryEditorRow extends PureComponent { const loader = getAngularLoader(); const template = ''; const scopeProps = { ctrl: this.getAngularQueryComponentScope() }; - this.angularQueryEditor = loader.load(this.element, scopeProps, template); this.angularScope = scopeProps.ctrl; - - // give angular time to compile - setTimeout(() => { - this.setState({ hasTextEditMode: !!this.angularScope.toggleEditorMode }); - }, 100); } onToggleCollapse = () => {