-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
If the argInt is equal to zero, scrollTabIntoView will not scroll to the tab 0.
So I change the if-check from truthy value check if(argInt) to number check if(argInt>=0).
$scope.scrollTabIntoView = function(arg){
if(!$scope.tabContainer || $scope.hideButtons)return;
var argInt = parseInt(arg);
var tabToScroll;
// first we find the tab element.
if(argInt>=0) { // scroll tab index into view
var allTabs = $scope.tabContainer.querySelectorAll('ul.nav-tabs > li');
if(allTabs.length > argInt) { // only if its really exist
tabToScroll = allTabs[argInt];
}
} else { // scroll selected tab into view
var activeTab = $scope.tabContainer.querySelector('li.active');
if(activeTab) {
tabToScroll = activeTab;
}
}
...
Metadata
Metadata
Assignees
Labels
No labels