Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Add/expose isVisibile, show, and hide methods for SidebarView object #3297

Merged
merged 2 commits into from
May 15, 2013
Merged

Add/expose isVisibile, show, and hide methods for SidebarView object #3297

merged 2 commits into from
May 15, 2013

Conversation

lkcampbell
Copy link
Contributor

For Issue #1187

Added public API functions for SidebarView object: show(), hide(), and visible().

Changed public API function: toggleSidebar() to toggle().

Did a find in files for current Brackets codebase and all currently listed Brackets extensions. toggleSidebar() is not used anywhere except for locally in SidebarView.js.

Ran unit tests without any problems. I'm not sure that SidebarView has any unit tests right now. If you want me to research and possibly create unit tests I can. Otherwise, this fix is complete and ready for review.

@ghost ghost assigned jasonsanjose Apr 9, 2013
@ghost ghost assigned redmunds May 15, 2013
@redmunds
Copy link
Contributor

@lkcampbell This looks pretty good.

Line 148 in SidebarView.js:

``` if (!$sidebar.is(":visible")) { ```

should use the new function:

``` if (!visible($sidebar)) { ```

UPDATE: Nevermind. That won't work since it's already a jQuery object.

@redmunds
Copy link
Contributor

Looks good. Merging.

redmunds added a commit that referenced this pull request May 15, 2013
Add/expose isVisibile, show, and hide methods for SidebarView object
@redmunds redmunds merged commit 3d4352a into adobe:master May 15, 2013
* Returns the visibility state of the sidebar.
* @return {boolean} true if element is visible, false if it is not visible
*/
function visible() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was merged already, but naming this function isVisible() would have been better, since it checks for the visible state and returns a boolean.

The same would apply to the new method in Resizer.js.

Maybe it could be changed as code cleanup before the Sprint ends.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion either way. They both sound good to me.

If you guys want me to change the name I will.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, @TomMalbran. @lkcampbell Yes, please change it to isVisible().

@lkcampbell lkcampbell deleted the fix-issue-1187 branch May 17, 2013 04:08
@lkcampbell
Copy link
Contributor Author

@redmunds and @TomMalbran, new pull request with cleanup submitted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants