From 9af6f96e277d53f0883425df31b597de6ae66ed6 Mon Sep 17 00:00:00 2001 From: Tasos Bekos Date: Sat, 24 Aug 2013 18:44:02 +0300 Subject: [PATCH] fix(tabs): evaluate `vertical` on parent scope Closes #849. --- src/tabs/docs/readme.md | 4 ++++ src/tabs/tabs.js | 2 +- src/tabs/test/tabsSpec.js | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tabs/docs/readme.md b/src/tabs/docs/readme.md index 15d77c606e..75f5c60fdb 100644 --- a/src/tabs/docs/readme.md +++ b/src/tabs/docs/readme.md @@ -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'. + #### `` #### * `heading` or `` diff --git a/src/tabs/tabs.js b/src/tabs/tabs.js index ab7f0b4263..45acd74283 100644 --- a/src/tabs/tabs.js +++ b/src/tabs/tabs.js @@ -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'); diff --git a/src/tabs/test/tabsSpec.js b/src/tabs/test/tabsSpec.js index e8a9822fef..692d42a9f4 100644 --- a/src/tabs/test/tabsSpec.js +++ b/src/tabs/test/tabsSpec.js @@ -468,8 +468,8 @@ describe('tabs', function() { describe('vertical', function() { beforeEach(inject(function($compile, $rootScope) { scope = $rootScope.$new(); - - elm = $compile('')(scope); + scope.vertical = true; + elm = $compile('')(scope); scope.$apply(); }));