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

accordion opening #4

Open
davidscotson opened this issue Sep 5, 2018 · 1 comment
Open

accordion opening #4

davidscotson opened this issue Sep 5, 2018 · 1 comment

Comments

@davidscotson
Copy link

I noticed that you had a .accordion class and data-parent set. I guess you hit the same issue I hit when looking at this, that the Bootstrap code expects very specific HTML for the accordion setup to work.

twbs/bootstrap#23767

This workaround

               $('.accordion').on('show.bs.collapse', function(event) {
                    $('.accordion .collapse.show').collapse('hide');
                });

Seems to work because that event gets triggered before .show gets added to the opening section.

Or to be more precise and avoid accidentally hitting any other collapsible content in labels etc.:

                    $('.accordion .section > .content > .collapse.show').collapse('hide');

It might be worth including as an option.

@jrm-unamur
Copy link
Collaborator

Hi David,
Indeed, allowing to close all other sections when opening one is a possible option.
However, its worth thinking about it, as regards how to propose it.

  • a site wide option to keep consistency among courses (admin decision)
  • a course option (teacher decision)
  • a user option (user decision)

I will discuss that with my team before going forward
Cheers

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

No branches or pull requests

2 participants