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

Commit 9af6f96

Browse files
bekospkozlowski-opensource
authored andcommitted
fix(tabs): evaluate vertical on parent scope
Closes #849.
1 parent d7a4852 commit 9af6f96

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/tabs/docs/readme.md

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ AngularJS version of the tabs directive.
1212
_(Defaults: 'tabs')_ :
1313
Navigation type. Possible values are 'tabs' and 'pills'.
1414

15+
* `direction`
16+
_(Defaults: null)_ :
17+
What direction the tabs should be rendered. Available: 'right', 'left', 'below'.
18+
1519
#### `<tab>` ####
1620

1721
* `heading` or `<tab-heading>`

src/tabs/tabs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function TabsetCtrl($scope, $element) {
8585
templateUrl: 'template/tabs/tabset.html',
8686
compile: function(elm, attrs, transclude) {
8787
return function(scope, element, attrs, tabsetCtrl) {
88-
scope.vertical = angular.isDefined(attrs.vertical) ? scope.$eval(attrs.vertical) : false;
88+
scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false;
8989
scope.type = angular.isDefined(attrs.type) ? scope.$parent.$eval(attrs.type) : 'tabs';
9090
scope.direction = angular.isDefined(attrs.direction) ? scope.$parent.$eval(attrs.direction) : 'top';
9191
scope.tabsAbove = (scope.direction != 'below');

src/tabs/test/tabsSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ describe('tabs', function() {
468468
describe('vertical', function() {
469469
beforeEach(inject(function($compile, $rootScope) {
470470
scope = $rootScope.$new();
471-
472-
elm = $compile('<tabset vertical="true"></tabset>')(scope);
471+
scope.vertical = true;
472+
elm = $compile('<tabset vertical="vertical"></tabset>')(scope);
473473
scope.$apply();
474474
}));
475475

0 commit comments

Comments
 (0)