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

Collapsable groups #59

Merged
merged 10 commits into from
Dec 9, 2014
Merged

Collapsable groups #59

merged 10 commits into from
Dec 9, 2014

Conversation

cluke009
Copy link
Contributor

Set up CMB2 to utilize the built in wordpress collapsable metabox styling on group fields #58

@jtsternberg
Copy link
Member

This is a cool concept, but looks like it could still use some tweaking. When I add a new group, the new group(s) is/are not collapsible, so that JS that triggers the collapsible stuff needs to be applied to each new group that is added. Also, I would prefer if we stuck w/ the class-based selectors and gave the h3 the cmb-group-title class.

@jtsternberg
Copy link
Member

Also, there needs to be some styling accommodations for repeatable groups in the sidebar: http://b.ustin.co/1fHSy

@cluke009
Copy link
Contributor Author

Collapsing the groups doesn't work with ajax right now. Any idea what js function needs to be called to refresh this?

I can add the classes back in. I think I removed them originally because of some funky styling that was being applied. I didn't really want to get into writing more css with this. It seems like we should be able to get away with writing very little css if we are smart about our usage of the built in classes/ids.

Good call on the sidebar I never bothered trying this in the sidebar just with some custom code and the example functions.

What kind of behavior would be preferable when new fields are added? Default to collapsed or accordion style where the other groups are collapsed something else? I am open to suggestion here. I tried to keep this patch pretty minimal and get some feedback before going to far with changes. I don't want to be stuck maintaining my own fork.

@cluke009
Copy link
Contributor Author

Fixed the ajax toggles and everything gets rebinded correctly.

There is the side effect of the drag and drop appearing to work but not actually saving the box order. It also isn't bound to the parent container so you can drag and drop outside of the containing metabox.

This might be a separate issue or we can just try to get all the wonkyness of this change ironed out under the one issue.

Trying to avoid the use of box-sizing. What IE version does WP support?
@cluke009
Copy link
Contributor Author

cluke009 commented Nov 5, 2014

Haven't really had any time to dig into the plugin recently but I did find out that removing the "hndle" class from the h3 disables the drag and drop functionality.

Could we get this merged in once the drag and drop is removed? The collapsing is really a live saver on large repeatable groups.

@jtsternberg
Copy link
Member

@cluke009 You're saying this is good to go, or still needs work? If wo, what work needs to be done?

@cluke009
Copy link
Contributor Author

Should be good to go. Pretty sure I addressed all the issues raised. If there is anything I missed just let me know.

@jtsternberg
Copy link
Member

@cluke009 Do you think you could update your PR after merging from master again? Some things have changed to repeatable groups, so your PR will break things as-is.

@cluke009
Copy link
Contributor Author

cluke009 commented Dec 8, 2014

Took a bit to fix the conflicts but everything is working again. Hopefully we can get this in soon as there are some other issues I would like to tackle.

@jtsternberg jtsternberg merged commit dcb1cd7 into CMB2:master Dec 9, 2014
@jtsternberg
Copy link
Member

Thank you and nice addition! I updated a couple styling things, and added a 'remove' icon/button to the group title bar.

@jtsternberg
Copy link
Member

Re: "other issues I would like to tackle", you can always create a new branch off of this repo's master and do a pull request w/ that branch. Then you could work on more than one thing simultaneously.

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

Successfully merging this pull request may close these issues.

2 participants