Skip to content
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

[Dropdown] Add back closeOnClick functionality for dropdowns. #7353

Merged
merged 6 commits into from
Dec 18, 2015

Conversation

tjhiggins
Copy link

Use this functionality heavily on our site.
Unsure why it was excluded in 6 so I disabled by default.

Shamelessly copied this commented out code from DropdownMenu. Then retooled to fit the new flow.

Do I also have to rebuild foundation.js in this pr?

Use this functionality heavily on our site.
Unsure why it was excluded in 6 so I disabled by default.
@tjhiggins
Copy link
Author

Looks like this breaks anything with data-close in dropdown. Going to fix and repush.

Also include edge case for when event target was removed
earlier in the event chain.
@tjhiggins
Copy link
Author

Updated. Solution is a little heavy handed, but powerful. Suggestions?

@zurbchris
Copy link
Contributor

seems like it would be much faster and less code to say:

if(_this.$element.find(e.target).length){
  return;
}
_this.close();
$body.off...

for the check if the click was in the dd or not. Otherwise, I think this is a fine feature.

@tjhiggins
Copy link
Author

@zurbchris Updated

@tjhiggins
Copy link
Author

Found another bug with my addBodyHandler, and a unused settings var in dropdown.scss

@tjhiggins tjhiggins changed the title Add back closeOnClick functionality for dropdowns. [Dropdown] Add back closeOnClick functionality for dropdowns. Dec 7, 2015
@zurbchris zurbchris added this to the v6.1 milestone Dec 10, 2015
@zurbchris
Copy link
Contributor

This is a pretty good feature. I've added it to the 6.1 Milestone list, and there will be a new 6.1 specific branch shortly if you could change this pr to that branch. Don't worry about compiling a new copy of the js, we'll take care of it.

@tjhiggins
Copy link
Author

@zurbchris #7478
Should I delete this pr?

@zurbchris
Copy link
Contributor

I'll take it in case the new dropdown isn't complete in time. I do like the feature :)

zurbchris added a commit that referenced this pull request Dec 18, 2015
[Dropdown] Add back closeOnClick functionality for dropdowns.
@zurbchris zurbchris merged commit 58a0255 into foundation:develop Dec 18, 2015
@rafibomb
Copy link
Member

@tjhiggins Thanks!

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

Successfully merging this pull request may close these issues.

3 participants