Skip to content

Commit

Permalink
docs: updates to language links
Browse files Browse the repository at this point in the history
  • Loading branch information
callmehiphop committed Aug 31, 2015
1 parent 60889c1 commit 74803ea
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,29 @@ angular
return {
templateUrl: 'site/components/language-switcher/language-switcher.html',
transclude: true,

link: function($scope, elem, attrs) {
$scope.extraLinks = $parse(attrs.extraLinks)($scope);
$scope.showNavDropdown = false;
},
controller: function($scope, $attrs) {
this.useApiDocs = $parse($attrs.useApiDocs)($scope);
}
};
})
.directive('apiDocs', function() {
'use strict';

return {
require: '^languageSwitcher',
restrict: 'A',
scope: {
href: '@',
apiDocs: '@'
},
link: function (scope, elem, attrs, switcher) {
if (switcher.useApiDocs) {
elem.attr('href', scope.href + scope.apiDocs);
}
}
};
});
6 changes: 3 additions & 3 deletions docs/site/components/language-switcher/language-switcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ <h4 class="list-item--heading">gcloud Libraries</h4>
</a>
</li>
<li>
<a href="#" title="gcloud-node Documentation" class="skip-external-link">
<a href="#" api-docs="/docs" title="gcloud-node Documentation" class="skip-external-link">
<img src="site/img/icon-lang-nodejs-white.svg" alt="gcloud-node" class="menu-icon">
Node.js
</a>
</li>
<li>
<a href="https://googlecloudplatform.github.io/gcloud-python/latest" title="gcloud-python Documentation" class="skip-external-link">
<a href="https://googlecloudplatform.github.io/gcloud-python" api-docs="/stable" title="gcloud-python Documentation" class="skip-external-link">
<img src="site/img/icon-lang-python.svg" alt="gcloud-python" class="menu-icon">
Python
</a>
</li>
<li>
<a href="https://googlecloudplatform.github.io/gcloud-ruby/docs/latest" title="gcloud-ruby Documentation" class="skip-external-link">
<a href="https://googlecloudplatform.github.io/gcloud-ruby" api-docs="/docs/latest" title="gcloud-ruby Documentation" class="skip-external-link">
<img src="site/img/icon-lang-ruby.svg" alt="gcloud-ruby" class="menu-icon">
Ruby
</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/components/subpage/subpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1 class="logo">
</a>
</h1>

<div language-switcher extra-links="{{links}}"></div>
<div language-switcher use-api-docs="true" extra-links="{{links}}"></div>

<div class="header--right">
<a href="https://github.com/GoogleCloudPlatform/gcloud-node/issues/new"
Expand Down

0 comments on commit 74803ea

Please sign in to comment.