Skip to content

Commit

Permalink
Add shortcut to open/close control panel (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Newtchuck authored and GauthierPLM committed May 20, 2018
1 parent 140d647 commit 49d77b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions keymaps/molecule-dev-environment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"atom-workspace": {
"alt-m": "molecule:hide-panel"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export function renderControlPanel(plan?: PlanConfig): void {
getURI() {
return "control-panel";
},
getAllowedLocations() {
return ["bottom"];
},
};

global.atom.workspace.open(paneItem);
Expand Down
7 changes: 7 additions & 0 deletions lib/molecule-dev-environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ export default {
"molecule:hide-panel": () => {
toolPlansPanel.hide();
const bottomDock = global.atom.workspace.getBottomDock();
const paneItem = global.atom.workspace.getPaneItems();
const controlPane = paneItem.find(elem => {
return elem.getTitle() == "Control Panel";
});
if (controlPane == undefined) {
renderControlPanel();
}
if (bottomDock.isVisible()) {
bottomDock.hide();
} else {
Expand Down

0 comments on commit 49d77b4

Please sign in to comment.