Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 6bb7b8f

Browse files
committed
fixed lint errors
1 parent 52b32f1 commit 6bb7b8f

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

app/directives/tc-tabs/tc-tabs.directive.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,47 +13,48 @@ import angular from 'angular'
1313
scope: {},
1414
controller: ['$log', '$location', '$scope', function($log, $location, $scope, $element) {
1515
$log = $log.getInstance('TcTabSetController')
16-
var tabCtrl = this;
16+
var tabCtrl = this
1717
this.tabs = []
1818
this.addTab = function addTab(tab) {
1919
this.tabs.push(tab)
2020
if (!angular.isDefined($location.search().tab) && this.tabs.length === 1) {
21-
tab.active = true;
21+
tab.active = true
2222
} else if ($location.search().tab === tab.heading) {
23-
tab.active = true;
23+
tab.active = true
2424
}
2525
}
2626

2727
this.select = function(selectedTab) {
28-
var select = false;
28+
var select = false
2929
angular.forEach(this.tabs, function(tab) {
3030
if (tab.active && tab.heading !== selectedTab.heading) {
31-
tab.active = false;
31+
tab.active = false
3232
} else if (tab.heading === selectedTab.heading) {
33-
tab.active = true;
34-
select = true;
33+
tab.active = true
34+
select = true
3535
}
36-
});
36+
})
3737
if (select === false && this.tabs.length > 0) {
38-
this.tabs[0].active = true;
38+
this.tabs[0].active = true
3939
}
4040
}
4141

4242
this.setTab = function(tab) {
4343
if ($location.search().tab !== tab.heading) {
44-
$location.search('tab', tab.heading);
44+
$location.search('tab', tab.heading)
4545
}
4646
}
4747

48-
$scope.$on( "$locationChangeSuccess", function() {
48+
$scope.$on( '$locationChangeSuccess', function() {
49+
var tab
4950
if (angular.isDefined($location.search().tab)) {
50-
var tab = $location.search().tab;
51-
tabCtrl.select({'heading' : tab});
51+
tab = $location.search().tab
52+
tabCtrl.select({'heading' : tab})
5253
} else if (tabCtrl.tabs.length > 0) {
53-
var tab = tabCtrl.tabs[0].heading;
54-
tabCtrl.select({'heading' : tab});
54+
tab = tabCtrl.tabs[0].heading
55+
tabCtrl.select({'heading' : tab})
5556
}
56-
});
57+
})
5758
}],
5859
controllerAs: 'tabSet'
5960
}

0 commit comments

Comments
 (0)