I'm using Bootstrap version 3.3.5 and have a view with two tabs to switch between two panes of content. I setup a listener for when a tab switch to the 'comments' pane happens. It fires the first time. But if I switch back and forth between tabs another time (or many times), the event never fires again.
$('#commentsTab').on('shown.bs.tab', function (e) {
console.log("do stuff here");
});
and here's the tab html:
<ul class="nav nav-pills side-tabs" role="tablist">
<li class="side-tab hidden-md hidden-lg" ng-class="oneColumn ? 'active' : ''" role="presentation">
<a href="" data-target="#topcard" data-toggle="tab" role="tab">{{title}}</a>
</li>
<li class="side-tab" ng-class="oneColumn ? '' : 'active'" role="presentation">
<a href="" data-target="#notes" data-toggle="tab" role="tab"><i class="fa fa-clone"></i>Notes</a>
</li>
<li role="presentation" class="side-tab">
<a id="commentsTab" class="comments-tab" href="" data-target="#comments" data-toggle="tab" role="tab"><i class="fa fa-comment-o"></i>Feedback</a>
</li>
</ul>
Anyone know how to make this work, so that I reliably get the event every time the tab is switched to?