backdrop-contrib / views_bootstrap

This module provides a set of styles for the Views module. It allows you to create responsive Bootstrap 3.x components, such as grids, carousels, tabs, and tables, all within the configuration settings of the powerful Views module.
https://backdropcms.org/project/views_bootstrap
GNU General Public License v2.0
0 stars 7 forks source link

Collapsed class is not default on collapsed accordion #8

Closed stpaultim closed 6 years ago

stpaultim commented 6 years ago

I'm using the accordion view and find that while the rows are collapsed by default, they do not get the collapsed class until they have been opened and then closed again.

I'm trying to add a Font Awesome icon to collapsed accordion panels, but they have the same classes as the uncollapsed panels, until they have been opened and then closed again.

stpaultim commented 6 years ago

I believe that the fix for this is to include the "collapsed" class on LINE 11 of

views-bootstrap-accordion-plugin-style.tpl.php

-            <a class="accordion-toggle"
+            <a class="accordion-toggle collapsed"

I have included it here on line 13.

9       <div class="panel-heading">
10         <h4 class="panel-title">
11           <a class="accordion-toggle collapsed"
12              data-toggle="collapse"
13              data-parent="#views-bootstrap-accordion-<?php print $id ?>"
14              href="#collapse-<?php print $id . '-' . $key ?>">
15              <?php print $titles[$key] ?>
16            </a>
17          </h4>
18        </div>