fix #89, fix closed sidebar on Safari

This commit is contained in:
catarak 2016-09-07 22:49:29 -04:00
parent 861a8f8759
commit 0e0d3975e1
5 changed files with 16 additions and 5 deletions

View File

@ -144,7 +144,11 @@ class Editor extends React.Component {
> >
<button <button
className="editor__options-button" className="editor__options-button"
onClick={this.props.showEditorOptions} tabIndex="0"
onClick={(e) => {
e.target.focus();
this.props.showEditorOptions();
}}
onBlur={() => setTimeout(this.props.closeEditorOptions, 200)} onBlur={() => setTimeout(this.props.closeEditorOptions, 200)}
> >
<InlineSVG src={downArrowUrl} /> <InlineSVG src={downArrowUrl} />

View File

@ -117,7 +117,10 @@ export class FileNode extends React.Component {
<button <button
className="sidebar__file-item-show-options" className="sidebar__file-item-show-options"
aria-label="view file options" aria-label="view file options"
onClick={() => this.props.showFileOptions(this.props.id)} onClick={(e) => {
e.target.focus();
this.props.showFileOptions(this.props.id);
}}
> >
<InlineSVG src={downArrowUrl} /> <InlineSVG src={downArrowUrl} />
</button> </button>

View File

@ -38,7 +38,10 @@ class Sidebar extends React.Component {
<button <button
aria-label="add file or folder" aria-label="add file or folder"
className="sidebar__add" className="sidebar__add"
onClick={this.props.openProjectOptions} onClick={(e) => {
e.target.focus();
this.props.openProjectOptions();
}}
onBlur={() => setTimeout(this.props.closeProjectOptions, 200)} onBlur={() => setTimeout(this.props.closeProjectOptions, 200)}
> >
<InlineSVG src={downArrowUrl} /> <InlineSVG src={downArrowUrl} />

View File

@ -50,7 +50,7 @@ class IDEView extends React.Component {
} }
this.consoleSize = this.props.ide.consoleIsExpanded ? 180 : 29; this.consoleSize = this.props.ide.consoleIsExpanded ? 180 : 29;
this.sidebarSize = this.props.ide.sidebarIsExpanded ? 200 : 20; this.sidebarSize = this.props.ide.sidebarIsExpanded ? 200 : 25;
this.forceUpdate(); this.forceUpdate();
this.isMac = navigator.userAgent.toLowerCase().indexOf('mac') !== -1; this.isMac = navigator.userAgent.toLowerCase().indexOf('mac') !== -1;
@ -63,7 +63,7 @@ class IDEView extends React.Component {
} }
if (this.props.ide.sidebarIsExpanded !== nextProps.ide.sidebarIsExpanded) { if (this.props.ide.sidebarIsExpanded !== nextProps.ide.sidebarIsExpanded) {
this.sidebarSize = nextProps.ide.sidebarIsExpanded ? 200 : 20; this.sidebarSize = nextProps.ide.sidebarIsExpanded ? 200 : 25;
} }
if (nextProps.params.project_id && !this.props.params.project_id) { if (nextProps.params.project_id && !this.props.params.project_id) {

View File

@ -191,6 +191,7 @@
display: block; display: block;
} }
top: 100%; top: 100%;
right: #{-70 / $base-font-size}rem;
padding: #{8 / $base-font-size}rem; padding: #{8 / $base-font-size}rem;
width: #{110 / $base-font-size}rem; width: #{110 / $base-font-size}rem;
} }