diff --git a/client/modules/IDE/components/Editor.jsx b/client/modules/IDE/components/Editor.jsx index a468fa4e..1d51ea9f 100644 --- a/client/modules/IDE/components/Editor.jsx +++ b/client/modules/IDE/components/Editor.jsx @@ -177,6 +177,15 @@ class Editor extends React.Component { } } + toggleEditorOptions() { + if (this.props.editorOptionsVisible) { + this.props.closeEditorOptions(); + } else { + this.refs.optionsButton.focus(); + this.props.showEditorOptions(); + } + } + _cm: CodeMirror.Editor render() { @@ -222,8 +231,7 @@ class Editor extends React.Component { tabIndex="0" ref="optionsButton" onClick={() => { - this.refs.optionsButton.focus(); - this.props.showEditorOptions(); + this.toggleEditorOptions(); }} onBlur={() => setTimeout(this.props.closeEditorOptions, 200)} > diff --git a/client/modules/IDE/components/FileNode.jsx b/client/modules/IDE/components/FileNode.jsx index 79e32e0c..b71d8fe8 100644 --- a/client/modules/IDE/components/FileNode.jsx +++ b/client/modules/IDE/components/FileNode.jsx @@ -48,6 +48,15 @@ export class FileNode extends React.Component { } } + toggleFileOptions() { + if (this.props.isOptionsOpen) { + this.props.hideFileOptions(this.props.id); + } else { + this.refs[`fileOptions-${this.props.id}`].focus(); + this.props.showFileOptions(this.props.id); + } + } + renderChild(childId) { return (