Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunxu committed Sep 22, 2015
1 parent f67d48a commit 5329f66
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions tabs/sx-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@
}
return firstActiveTabId || firstEnabledTabId;
};
$q.when(scope.$tabs)
.then(function (tabs) {
$q.when(scope.$tabs).then(function (tabs) {
scope.$tabs = tabs;
scope.$tabsOrder = (function () {
var orders = [];
Expand All @@ -327,27 +326,26 @@
});
return orders;
}());
return $q.when(scope.$context);
})
.then(function (context) {
scope.$context = context || {};
return $q.when(scope.$context);
}).then(function (context) {
scope.$context = context || {};
scope.showTabsPlusIcon = _getAndUpdateTabsPlusIconFlag();
scope.enabledTabsCount = _getAndUpdateEnabledTabsCount();
// load template for visible tabs
window.angular.forEach(scope.$tabs, function (tab) {
tab.entered = false;
scope.enabledTabsCount = _getAndUpdateEnabledTabsCount();
// load template for visible tabs
window.angular.forEach(scope.$tabs, function (tab) {
tab.entered = false;
delete tab.$scope;
delete tab.$controller;
_setTemplatePromise(tab);
});
_setTemplatePromise(tab);
});

// switch to the active tab
// if no active tab or that tab was disabled then go to the first enabled tab
scope.switchTab({
e: null,
id: _findLandingTab(),
byTabDisabled: true
}, window.angular.noop);
// switch to the active tab
// if no active tab or that tab was disabled then go to the first enabled tab
scope.switchTab({
e: null,
id: _findLandingTab(),
byTabDisabled: true
}, window.angular.noop);
});
}
};
Expand Down

0 comments on commit 5329f66

Please sign in to comment.