mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-29 23:09:05 +02:00
Fixes #7213 Collapse plugin does not correctly set the "collapsed" class on accordion heading links
This commit is contained in:
6
js/bootstrap-collapse.js
vendored
6
js/bootstrap-collapse.js
vendored
@@ -160,6 +160,12 @@
|
||||
|| e.preventDefault()
|
||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
||||
, parent = $this.attr('data-parent')
|
||||
, $parent = parent && $(parent)
|
||||
|
||||
if ($parent) {
|
||||
$parent.find('[data-toggle=collapse][data-parent=' + parent + ']').not($this).addClass('collapsed')
|
||||
}
|
||||
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||
$(target).collapse(option)
|
||||
})
|
||||
|
Reference in New Issue
Block a user