<p dir="auto">when having an accordion <code class="notranslate">.accordion-toggle</code> gets class <code class="notranslate">collapsed</code> when specified section is collapsed.</p>
<p dir="auto">however, this hapens only when clicking on the same handler.</p>
<p dir="auto">example: <a href="http://jsfiddle.net/DRfbh/" rel="nofollow">http://jsfiddle.net/DRfbh/</a></p>
<p dir="auto">red background indicates that <code class="notranslate">.accordion-toggle</code> does not have class <code class="notranslate">collapsed</code>.</p>
<p dir="auto">Clicking on the first item, works ok, but when clicking any other item, opened section is collapsed, but class is not added to the <code class="notranslate">.accordion-toggle</code></p>
<p dir="auto">This line:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')"><pre class="notranslate"><span class="pl-s1">$this</span><span class="pl-kos">[</span><span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">hasClass</span><span class="pl-kos">(</span><span class="pl-s">'in'</span><span class="pl-kos">)</span> ? <span class="pl-s">'addClass'</span> : <span class="pl-s">'removeClass'</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-s">'collapsed'</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">Only works to remove or add the collapsed class on the element clicked. It does not updated the element that was previously expanded/clicked. So the class usage becomes inconsistent quickly and stops me easily styling stuff.</p>
<p dir="auto">Note diff b/w accordion-heading and accordion-body.</p>