File tree Expand file tree Collapse file tree
docs/site/components/subpage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,10 +20,13 @@ angular
2020 } ;
2121
2222 if ( $scope . versionSelected === 'master' ) {
23- $http . get ( 'https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/commits?sha=gh-pages&per_page=1' )
24- . then ( function ( resp ) {
25- $scope . lastBuiltDate = moment ( resp . data [ 0 ] . commit . committer . date ) ;
26- } ) ;
23+ $http ( {
24+ method : 'get' ,
25+ url : 'https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/commits?sha=gh-pages&per_page=1' ,
26+ cache : true
27+ } ) . then ( function ( resp ) {
28+ $scope . lastBuiltDate = moment ( resp . data [ 0 ] . commit . committer . date ) ;
29+ } ) ;
2730 }
2831
2932 if ( attrs . isActiveUrl ) {
@@ -33,6 +36,10 @@ angular
3336 return $location . path ( ) === url . replace ( '#' , '' ) ;
3437 } ;
3538 }
39+
40+ $scope . isActiveClass = function ( module ) {
41+ return $location . path ( ) . indexOf ( module . url . replace ( '#' , '' ) ) === 0 ;
42+ } ;
3643 }
3744 } ;
3845 } )
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ <h4 class="list-item--heading">API</h4>
8484 ng-href ="{{page.url}} ">
8585 {{page.title}}
8686 </ a >
87- < ul class ="sub-sections " ng-if ="page.pages ">
87+ < ul class ="sub-sections " ng-if ="page.pages && isActiveClass(page) ">
8888 < li ng-repeat ="innerPage in page.pages ">
8989 < a
9090 ng-class ="{ current: isActiveUrl(page.url + innerPage.url) } "
You can’t perform that action at this time.
0 commit comments