Skip to content

Commit 26d14c9

Browse files
committed
fix(tabs): evaluate vertical on parent scope
Closes angular-ui#849.
1 parent d7a4852 commit 26d14c9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/tabs/docs/readme.md

Lines changed: 4 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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)