-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLOSED] Add/expose isVisibile, show, and hide methods for SidebarView object #1172
Comments
Comment by johannesboyne hey,
greetings |
Comment by danilocelic Yes, I am aware of that code, and it does exactly the same thing as the SidebarView.toggleSidebar() method I mentioned in my initial post; however if you want to specifically close the side bar and you call this code when it's already closed it'll open up. I've hacked together some code that adds a show and hide method as well as expose the isSidebarClosed private variable, when I get GIT installed and configured I'll try to do a pull request to get it into Brackets (if it's something that others would want to have) |
Comment by tvoliter Note that Commands objects have an execute() function so you can use this slightly shorter form: CommandManager.get(Commands.VIEW_HIDE_SIDEBAR).execute(); |
Comment by pthiess Reviewed |
Comment by lkcampbell Submitted a pull request to fix this bug: adobe/brackets#3297 |
Comment by redmunds
|
Issue by danilocelic
Thursday Jun 28, 2012 at 15:18 GMT
Originally opened as adobe/brackets#1187
The /project/SidebarView object exposes a toggle() method, but if other code wants to perform a show or hide, there is no way to choose to show or hide it based on some other condition (for example going into or out of a zen or focus mode) without using code that hides the sidebar via CSS which I'd like to avoid.
If there were dedicated show and hide methods, a developer could call only the specific functionality that is required rather than pulling from preferences as might currently need to be done, which might have its own perils if defaults for preference access are not kept in sync.
There is already a private variable named "isSidebarClosed" (not prefixed with _ in case it matters) that could be exposed in order to determine if you should even call the show or hide method (to prevent unnecessary code execution), or perhaps the show and hide methods themselves could only perform their action when appropriate.
The text was updated successfully, but these errors were encountered: