1
0
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:
Ivan Khalopik
2013-03-29 17:55:14 +03:00
parent d5303906bd
commit 41c7825677
2 changed files with 41 additions and 0 deletions

View File

@@ -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)
})