Merge pull request #1283 from shakti97/sidebar-shortcut
Feature sidebar toggle shortcut
This commit is contained in:
commit
4eda1654c5
2 changed files with 13 additions and 0 deletions
|
@ -74,6 +74,12 @@ function KeyboardShortcutModal() {
|
||||||
</span>
|
</span>
|
||||||
<span>Turn off Accessible Output</span>
|
<span>Turn off Accessible Output</span>
|
||||||
</li>
|
</li>
|
||||||
|
<li className="keyboard-shortcut-item">
|
||||||
|
<span className="keyboard-shortcut__command">
|
||||||
|
{metaKeyName} + B
|
||||||
|
</span>
|
||||||
|
<span>Toggle Sidebar</span>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,6 +156,13 @@ class IDEView extends React.Component {
|
||||||
} else if (e.keyCode === 49 && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac)) && e.shiftKey) {
|
} else if (e.keyCode === 49 && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac)) && e.shiftKey) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.setAllAccessibleOutput(true);
|
this.props.setAllAccessibleOutput(true);
|
||||||
|
} else if (e.keyCode === 66 && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac))) {
|
||||||
|
e.preventDefault();
|
||||||
|
if (!this.props.ide.sidebarIsExpanded) {
|
||||||
|
this.props.expandSidebar();
|
||||||
|
} else {
|
||||||
|
this.props.collapseSidebar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue