From b8bc70c67616cb9c22ecda9eb0d53e6a32452407 Mon Sep 17 00:00:00 2001 From: Alex Oates Date: Tue, 28 Mar 2017 17:10:41 +0100 Subject: [PATCH] Fix for issue where all first li's across the page get an active class when running showTabs --- bootstrap-tabcollapse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-tabcollapse.js b/bootstrap-tabcollapse.js index 76e1279..b514acd 100644 --- a/bootstrap-tabcollapse.js +++ b/bootstrap-tabcollapse.js @@ -80,8 +80,8 @@ $parentLi.append($panelHeading); }); - if (!$('li').hasClass('active')) { - $('li').first().addClass('active') + if (!$panelHeadings.parent().hasClass('active')) { + $panelHeadings.parent().first().addClass('active') } var $panelBodies = this.$accordion.find('.js-tabcollapse-panel-body');