1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 21:09:06 +02:00

Update all collapse triggers with .collapsed class and aria-expanded

Fixes #15741
Closes #15751 by merging it.
This commit is contained in:
Ivan Cheung
2015-02-04 16:25:57 -06:00
committed by Chris Rebert
parent 984204c39e
commit d5071b19f1
2 changed files with 75 additions and 7 deletions

View File

@@ -16,7 +16,8 @@
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"][href="#' + element.id + '"],' +
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
this.transitioning = null
if (this.options.parent) {
@@ -33,8 +34,7 @@
Collapse.TRANSITION_DURATION = 350
Collapse.DEFAULTS = {
toggle: true,
trigger: '[data-toggle="collapse"]'
toggle: true
}
Collapse.prototype.dimension = function () {
@@ -203,7 +203,7 @@
var $target = getTargetFromTrigger($this)
var data = $target.data('bs.collapse')
var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })
var option = data ? 'toggle' : $this.data()
Plugin.call($target, option)
})