-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Handle collapsed
class on triggers even when manually invoked
#14686
Conversation
This turned out to be a rather large refactor as virtually all the behavior that happened by clicking a toggle was poorly implemented and did not respect potentially prevented |
CC: @fat |
+ '<div class="accordion-group"/>' | ||
+ '<div class="accordion-group"/>' | ||
+ '<div class="accordion-group"/>' | ||
var accordionHTML = '<div class="panel-group accordion">' |
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.
perhaps we should make accordion
an id
instead of a class
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.
Yeah, that's what I was thinking at first too but the whole unit test is about this group not having an ID but a class.
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.
Ah. Nevermind then.
5916860
to
8c995e1
Compare
@@ -116,6 +130,33 @@ | |||
this[this.$element.hasClass('in') ? 'hide' : 'show']() | |||
} | |||
|
|||
Collapse.prototype.getParent = function () { |
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.
@fat Is this what you meant?
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.
ya
8c995e1
to
4b2646e
Compare
Pinging @fat for final review. |
this.options = $.extend({}, Collapse.DEFAULTS, options) | ||
this.$trigger = $(this.options.trigger || '[data-toggle="collapse"]').filter('[href="#' + el.id + '"], [data-target="#' + el.id + '"]') |
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.
if you're worried about this being long, just break it onto multiple lilnes
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.
why isn't '[data-toggle="collapse"]'
just the default value for the trigger option?
seems mostly good, just small things |
4b2646e
to
ed3a65f
Compare
Handle `collapsed` class on triggers even when manually invoked
This seems to still be broken in v3.3.2. Is the expected usage: |
@elvirb Please file a new issue with a live example. Thanks. |
Fixes #13636.