-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Fix broken pane toggle #613
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! This approach (accepting arbitrary input and toggling if it isn't something we recognize) should conflate the last two else if/else conditions since they are logically identical.
Alternatively, to keep the strict togglePane API which only accepts reasonable 'show' arguments I would suggest instead changing line 182 from on(this.collapseButtons[key], 'click', lang.hitch(this, 'togglePane', key));
to on(this.collapseButtons[key], 'click', lang.hitch(this, 'togglePane', key, null, false));
and line 231 from } else if (show === undefined) {
to } else if (show === undefined || show === null) {
.
Either technically works, I leave the choice of which approach is preferred up to the maintainers.
error: 'Invalid type passed as "show" property of "togglePane" function : ' + typeof(show) | ||
}); | ||
return; | ||
newDisp = (domStyle.get(domNode, 'display') === 'none') ? 'block' : 'none'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is logically identical to the above case, so if we want to accept arbitrary input for the 'show' parameter we should just remove this error condition and change the else if (show === undefined)
case to else
Agreed, I like the second approach:
|
I like the second approach as well. For consistency, the |
Agreed! |
Just noticed, you guys both have the same last names...are you related? 😃 |
f6e7844
to
942117b
Compare
942117b
to
1fafd15
Compare
@roemhildtg can you also add the additional argument here. |
@amcgee merge base branch. thanks guys! |
^^^ @roemhildtg that comment is for you. Hoping you can also include the request in my comment. |
yep! sorry @roemhildtg my bad, thanks! |
Sorry! So just to be sure, that should be changed to |
@roemhildtg how about passing |
Okay, gotcha. |
Panes are not toggleable by the button since #607