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

Collapse with parent assumes .panel #15341

Closed
alexrussell opened this issue Dec 11, 2014 · 7 comments
Closed

Collapse with parent assumes .panel #15341

alexrussell opened this issue Dec 11, 2014 · 7 comments
Labels

Comments

@alexrussell
Copy link

The collapse plugin, when used with data-parent="{selector}", appears to assume that you are using panels (presumably because of the original accordion use-case). Line 49 of the plugin has a specific reliance on .panel in the code, but is there any reason for this? I have code that has a similar close-all-others-within-a-container mechanism, but has very little need of using panels. Is this something that can/should be changed (now that #15241 is merged, reducing the emphasis on accordions using panels) or is there a good reason for the reliance on panels?

@barryvdh
Copy link
Contributor

Just facing the same issue, so 👍 for decoupling from styling.

@alexrussell
Copy link
Author

Glad it wasn't just me. I did wonder if I was just missing something. I changed .panel to * in my local JS file and it does appear to work without issue.

@juthilo juthilo added css js and removed css labels Dec 11, 2014
@cvrebert
Copy link
Collaborator

X-Ref: #8892, 201088c

@bassjobsen
Copy link
Contributor

Instead of changing the selector to > * i suggest to change it to > .panel, > .collapsible-item. Their is no need to define any style rules for .collapsible-item here, but it can be used for that purpose too.

Or alternatively make it an option with > .panel as default. The data-..... for this option should be set on the parent element.

@alexrussell
Copy link
Author

If I'm honest, I don't really see the gain in introducing more markup (in this case the collapsible-item classname) than is required, but at the same time there's not much harm that I can see.

In my specific case, it luckily works pretty much like panels, but just without the panel markup, and thus works with the JS that exists, after changing .panel to *. I have something like this: ul > (li > .title[data-toggle=collapse] + ul.collapse > li*)*, so the collapse trigger is the .title, with the collapsible element being the second-level uls. So yes, I could of course just stick .collapsible-item on those uls but I don't feel that there's much need to.

thibault added a commit to Talengi/phase that referenced this issue Mar 24, 2015
Because this bug is still unresolved.

twbs/bootstrap#15341
@cvrebert
Copy link
Collaborator

@fat I believe we decided to punt this to v4, correct?

@mdo
Copy link
Member

mdo commented Apr 27, 2015

Yeah this will change in v4.

@mdo mdo closed this as completed Apr 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants