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

Fix #15741: Update all collapse triggers with collapsed class and aria-expanded #15751

Closed
wants to merge 4 commits into from

Conversation

ijcheung
Copy link
Contributor

@ijcheung ijcheung commented Feb 4, 2015

Fixes #15741. I removed the trigger option. Please let me know if it actually does something.

@twbs-savage
Copy link

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 73e5911
Build details: https://travis-ci.org/twbs-savage/bootstrap/builds/49528044

(Please note that this is a fully automated comment.)

@twbs-savage
Copy link

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 96a0230
Build details: https://travis-ci.org/twbs-savage/bootstrap/builds/49529418

(Please note that this is a fully automated comment.)

@ijcheung
Copy link
Contributor Author

ijcheung commented Feb 6, 2015

Trigger option was introduced in #14686, and its removal does not break that fix afaik.

@patrickhlauke
Copy link
Member

/cc @fat for review

@twbs-savage
Copy link

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 4dd7c0b
Build details: https://travis-ci.org/twbs-savage/bootstrap/builds/49961210

(Please note that this is a fully automated comment.)

@cvrebert cvrebert added the js label Feb 10, 2015
@cvrebert cvrebert changed the title [Fix Issue #15741] Update all collapse triggers with collapsed class and aria-expanded Fix #15741: Update all collapse triggers with collapsed class and aria-expanded Feb 21, 2015
@ijcheung
Copy link
Contributor Author

@cvrebert any update on this XD

@cvrebert
Copy link
Collaborator

Hmm, trigger was never publicly documented, so we can remove it without breaking compatibility. /cc @hnrch02 since he was the one who added that option.

@@ -16,7 +16,7 @@
var Collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Collapse.DEFAULTS, options)
this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
this.$trigger = $('[data-toggle="collapse"]').filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a slightly more complex selector and getting rid of the filter intuitively seems like it would be faster, although I haven't microbenchmarked it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it would need to be '[data-toggle="collapse"][href="' + element.id '"], [data-toggle="collapse"][data-target="#' + element.id + '"]' which is longer.

@hnrch02
Copy link
Collaborator

hnrch02 commented Feb 26, 2015

The reason I introduced it was so I could pass the trigger element along directly but this change makes sense.

@@ -80,7 +80,7 @@ $(function () {
$('<div id="test1"/>')
.appendTo('#qunit-fixture')
.on('shown.bs.collapse', function () {
ok(!$target.hasClass('collapsed'))
ok(!$target.hasClass('collapsed'), 'target does not have class collapsed')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"target does not have collapsed class"

@hnrch02
Copy link
Collaborator

hnrch02 commented Feb 26, 2015

Needs a rebase and after fixing up those nitpicks :shipit:

@cvrebert
Copy link
Collaborator

Superseded by #15941, which applies the feedback from the code review and has been rebased.

@cvrebert cvrebert closed this Feb 27, 2015
@cvrebert cvrebert removed this from the v3.3.4 milestone Feb 27, 2015
cvrebert pushed a commit that referenced this pull request Feb 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants