Skip to content

Commit

Permalink
fix(tabs): angular-ui#2883 select gets called twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Casey Garland authored and wesleycho committed Aug 18, 2015
1 parent 790d6b9 commit 3a4435d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tabs/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ angular.module('ui.bootstrap.tabs', [])
if (tab.active && tab !== selectedTab) {
tab.active = false;
tab.onDeselect();
selectedTab.selectCalled = false;
}
});
selectedTab.active = true;
selectedTab.onSelect();
// only call select if it has not already been called
if (!selectedTab.selectCalled) {
selectedTab.onSelect();
selectedTab.selectCalled = true;
}
};

ctrl.addTab = function addTab(tab) {
Expand Down

0 comments on commit 3a4435d

Please sign in to comment.