From d0f90b00c8520d7b825072faf7aea5d8402e435a Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Tue, 3 Dec 2013 14:14:07 -0700 Subject: [PATCH] Closes #538. Closes #722 --- src/vendor/angular/angular-strap.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vendor/angular/angular-strap.js b/src/vendor/angular/angular-strap.js index caee5eecbd7..189d9ef4b2a 100644 --- a/src/vendor/angular/angular-strap.js +++ b/src/vendor/angular/angular-strap.js @@ -712,11 +712,15 @@ angular.module('$strap.directives').directive('bsTabs', [ scope.$watch(iAttrs.ngModel, function (newValue, oldValue) { if (angular.isUndefined(newValue)) return; + console.log(oldValue +" -> "+ newValue); activeTab = newValue; setTimeout(function () { - var $next = $($tabs[0].querySelectorAll('li')[newValue * 1]); - if (!$next.hasClass('active')) { - $next.children('a').tab('show'); + // Check if we're still on the same tab before making the switch + if(activeTab === newValue) { + var $next = $($tabs[0].querySelectorAll('li')[newValue * 1]); + if (!$next.hasClass('active')) { + $next.children('a').tab('show'); + } } }); });