Skip to content

Commit

Permalink
changes needed to make default editor work with react component (#12196)
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese authored and ppisljar committed Jun 7, 2017
1 parent b5f18e9 commit 0de721f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ui/public/vis/editors/default/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const defaultEditor = function ($rootScope, $compile) {

if (!this.vis.type.editorConfig.optionTabs && this.vis.type.editorConfig.optionsTemplate) {
this.vis.type.editorConfig.optionTabs = [
{ name: 'options', title: 'Options', editor: this.editorConfig.optionsTemplate }
{ name: 'options', title: 'Options', editor: this.vis.type.editorConfig.optionsTemplate }
];
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/vis/editors/default/vis_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ uiModules
const reactOptionsComponent = typeof $scope.editor !== 'string';
const renderReactComponent = () => {
const Component = $scope.editor;
render(<Component scope={$scope} />, $el);
render(<Component scope={$scope} />, $el[0]);
};
// Bind the `editor` template with the scope.
if (reactOptionsComponent) {
Expand All @@ -50,7 +50,7 @@ uiModules

$el.on('$destroy', () => {
if (reactOptionsComponent) {
unmountComponentAtNode($el);
unmountComponentAtNode($el[0]);
}
});
}
Expand Down

0 comments on commit 0de721f

Please sign in to comment.