From 41c782567775d3bbcfc62d163ae22a531277b5e2 Mon Sep 17 00:00:00 2001 From: Ivan Khalopik Date: Fri, 29 Mar 2013 17:55:14 +0300 Subject: Fixes #7213 Collapse plugin does not correctly set the "collapsed" class on accordion heading links --- js/bootstrap-collapse.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/bootstrap-collapse.js') diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js index 2730a48d4..813462a24 100644 --- a/js/bootstrap-collapse.js +++ b/js/bootstrap-collapse.js @@ -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) }) -- cgit v1.2.3