openam / bootstrap-responsive-tabs

Bootstrap responsive tabs are tabs that switch to collapsible components (accordions) when resized.
openam.github.io/bootstrap-responsive-tabs
MIT License
132 stars 60 forks source link

Tab anchors without href attribute cause error #70

Open sbatty opened 6 years ago

sbatty commented 6 years ago

Standard bootstrap markup allows for tab anchors to utilize either the href attribute or a data-target attribute.

Responsive tabs will not work without the href attribute.

openam commented 6 years ago

In bootstrap 3?

sbatty commented 6 years ago

Yes, sorry, 3.3.7

I've discovered that I also get this error when I click on an accordion header to open or close an accordion panel: (line 178 throws error)

173        // Toggle the tab when the associated panel is toggled
174        collapse.on('shown.bs.collapse', function (e) {
175
176           if (fakewaffle.currentPosition === 'panel') {
177                // Activate current tabs
178               var current = $(e.target).context.id.replace(/collapse-/g, '#');
179                $('a[href="' + current + '"]').tab('show');
180
181                // Update the content with active
182               var panelGroup = $(e.currentTarget).closest('.panel-group.responsive');
183                $(panelGroup).find('.panel-body').removeClass('active');
184                $(e.currentTarget).find('.panel-body').addClass('active');
185            }
186
186        });