diff options
| author | Matias Niemelä | 2014-02-17 16:36:22 -0500 | 
|---|---|---|
| committer | Matias Niemelä | 2014-02-17 16:36:22 -0500 | 
| commit | 666137d6359c9474c9912fc81ebc4d8f478cc1b5 (patch) | |
| tree | 7dff2e10ad28228631f84079fcf04780544c4209 /docs/app | |
| parent | 846ebb4073ed56ab7d56539bb778fb82db80c35d (diff) | |
| download | angular.js-666137d6359c9474c9912fc81ebc4d8f478cc1b5.tar.bz2 | |
chore(docs): fix broken example tabs
Diffstat (limited to 'docs/app')
| -rw-r--r-- | docs/app/assets/js/angular-bootstrap/bootstrap.js | 12 | 
1 files changed, 6 insertions, 6 deletions
| diff --git a/docs/app/assets/js/angular-bootstrap/bootstrap.js b/docs/app/assets/js/angular-bootstrap/bootstrap.js index 643b5a50..7635216a 100644 --- a/docs/app/assets/js/angular-bootstrap/bootstrap.js +++ b/docs/app/assets/js/angular-bootstrap/bootstrap.js @@ -18,6 +18,7 @@ directive.runnableExample = ['$templateCache', '$document', function($templateCa    return {      restrict: 'C', +    scope : true,      controller : ['$scope', function($scope) {        $scope.setTab = function(index) {          var tab = $scope.tabs[index]; @@ -28,21 +29,20 @@ directive.runnableExample = ['$templateCache', '$document', function($templateCa      compile : function(element) {        element.html(tpl + element.html());        return function(scope, element) { +        var node = element[0]; +        var examples = node.querySelectorAll(exampleClassNameSelector);          var tabs = [], now = Date.now(); -        angular.forEach(doc.querySelectorAll(exampleClassNameSelector), -          function(child, index) { - +        angular.forEach(examples, function(child, index) {            tabs.push(child.getAttribute('name'));          });          if(tabs.length > 0) {            scope.tabs = tabs;            scope.$on('tabChange', function(e, index, title) { -            var elements = doc.querySelectorAll(exampleClassNameSelector); -            angular.forEach(elements, function(child) { +            angular.forEach(examples, function(child) {                child.style.display = 'none';              }); -            var selected = elements[index]; +            var selected = examples[index];              selected.style.display = 'block';            });            scope.setTab(0); | 
