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

Merge pull request #7424 from sody/3.0.0-wip

Fixes #7213 Collapse plugin does not correctly set the "collapsed" class.
This commit is contained in:
Jacob
2013-06-27 22:36:33 -07:00
2 changed files with 38 additions and 0 deletions

View File

@@ -145,7 +145,10 @@
|| e.preventDefault()
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
var option = $(target).data('collapse') ? 'toggle' : $this.data()
var parent = $this.attr('data-parent')
var $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)
})