Last active
January 28, 2016 09:43
-
-
Save rainydio/7614e88a722c91b34941 to your computer and use it in GitHub Desktop.
Hide tree view when entering full screen mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do () -> | |
restoreTreeView = false | |
hasTreeView = () -> | |
return document.getElementsByClassName "tree-view" | |
.length isnt 0 | |
atom.commands.onDidDispatch (e) -> | |
if e.type is "window:toggle-full-screen" | |
if atom.isFullScreen() | |
if hasTreeView() | |
atom.commands.dispatch \ | |
atom.views.getView(atom.workspace), | |
'tree-view:toggle' | |
restoreTreeView = true | |
else | |
if restoreTreeView and not hasTreeView() | |
atom.commands.dispatch \ | |
atom.views.getView(atom.workspace), | |
'tree-view:toggle' | |
if e.type is "tree-view:toggle" or e.type is "tree-view:show" | |
restoreTreeView = false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment