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

Commit

Permalink
fix(tabs): evaluate vertical on parent scope
Browse files Browse the repository at this point in the history
Closes #849.
  • Loading branch information
bekos authored and pkozlowski-opensource committed Aug 24, 2013
1 parent d7a4852 commit 9af6f96
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/tabs/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ AngularJS version of the tabs directive.
_(Defaults: 'tabs')_ :
Navigation type. Possible values are 'tabs' and 'pills'.

* `direction`
_(Defaults: null)_ :
What direction the tabs should be rendered. Available: 'right', 'left', 'below'.

#### `<tab>` ####

* `heading` or `<tab-heading>`
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function TabsetCtrl($scope, $element) {
templateUrl: 'template/tabs/tabset.html',
compile: function(elm, attrs, transclude) {
return function(scope, element, attrs, tabsetCtrl) {
scope.vertical = angular.isDefined(attrs.vertical) ? scope.$eval(attrs.vertical) : false;
scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false;
scope.type = angular.isDefined(attrs.type) ? scope.$parent.$eval(attrs.type) : 'tabs';
scope.direction = angular.isDefined(attrs.direction) ? scope.$parent.$eval(attrs.direction) : 'top';
scope.tabsAbove = (scope.direction != 'below');
Expand Down
4 changes: 2 additions & 2 deletions src/tabs/test/tabsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ describe('tabs', function() {
describe('vertical', function() {
beforeEach(inject(function($compile, $rootScope) {
scope = $rootScope.$new();

elm = $compile('<tabset vertical="true"></tabset>')(scope);
scope.vertical = true;
elm = $compile('<tabset vertical="vertical"></tabset>')(scope);
scope.$apply();
}));

Expand Down

0 comments on commit 9af6f96

Please sign in to comment.