Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(tabset): preserve tabset class attribute #584

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/tabs/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function TabsetCtrl($scope, $element) {
controller: 'TabsetController',
templateUrl: 'template/tabs/tabset.html',
link: function(scope, element, attrs) {
scope.class = angular.isDefined(attrs.class) ? attrs.class : '';
scope.vertical = angular.isDefined(attrs.vertical) ? scope.$eval(attrs.vertical) : false;
scope.type = angular.isDefined(attrs.type) ? scope.$parent.$eval(attrs.type) : 'tabs';
}
Expand Down
13 changes: 13 additions & 0 deletions src/tabs/test/tabsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,19 @@ describe('tabs', function() {
});
});

describe('class', function() {
beforeEach(inject(function($compile, $rootScope) {
scope = $rootScope.$new();

elm = $compile('<tabset class="tabs-left"></tabset>')(scope);
scope.$apply();
}));

it('to stack tabs', function() {
expect(elm.find('div.tabbable')).toHaveClass('tabs-left');
});
});

describe('type', function() {
beforeEach(inject(function($compile, $rootScope) {
scope = $rootScope.$new();
Expand Down
2 changes: 1 addition & 1 deletion template/tabs/tabset.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="tabbable">
<div class="tabbable {{class}}">
<ul class="nav {{type && 'nav-' + type}}" ng-class="{'nav-stacked': vertical}" ng-transclude>
</ul>
<div class="tab-content">
Expand Down