Skip to content

Commit

Permalink
move permalink to #.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Sep 6, 2014
1 parent 2da7cb4 commit b0443e5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
13 changes: 8 additions & 5 deletions docs/components/docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,14 @@ <h1>{{module[0].toUpperCase() + module.substr(1)}}</h1>
<h2 ng-if="method.name[0].toUpperCase() === method.name[0]">
{{method.name}}
</h2>
<h3 ng-if="method.name[0].toUpperCase() !== method.name[0]">
<span ng-if="noHeadingLink">{{method.name}}</span>
<a ng-if="!noHeadingLink" ng-href="{{activeUrl + '/' + method.name}}">
{{method.name}}
</a>
<h3
class="method-heading"
ng-if="method.name[0].toUpperCase() !== method.name[0]">
<a
class="permalink"
ng-if="!noPermalink"
ng-href="{{activeUrl + '/' + method.name}}">#</a>
{{method.name}}
</h3>
<p ng-if="method.description" ng-bind-html="method.description"></p>
<h4 ng-show="method.params">Parameters</h4>
Expand Down
6 changes: 3 additions & 3 deletions docs/components/docs/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ angular
return $http.get('/gcloud-node/json/index.json')
.then(filterDocJson($sce))
.then(function(methods) {
// Prevent headings from turning into links.
// Prevent displaying permalinks.
// ** Can remove when PubSub api is documented **
methods.noHeadingLink = true;
methods.noPermalink = true;
return methods;
});
}
Expand Down Expand Up @@ -200,7 +200,7 @@ angular

$scope.activeUrl = '/gcloud-node/#' + $location.path();
$scope.singleMethod = methods.singleMethod;
$scope.noHeadingLink = methods.singleMethod || methods.noHeadingLink;
$scope.noPermalink = methods.singleMethod || methods.noPermalink;
$scope.methods = methods;
$scope.module = $routeParams.module;
$scope.pages = [
Expand Down
22 changes: 22 additions & 0 deletions docs/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,28 @@ h1, h2, h3, h4, h5, h6 {
border-bottom: 1px solid rgba(0,0,0,0.05);
}

.method-heading {
position: relative;
}

.permalink {
display: none;
position: absolute;
padding: 0 7px;
left: -24px;
text-decoration: none;
color: #2b70e2;
}

.permalink:hover {
color: #4285f4;
display: block;
}

.method-heading:hover .permalink {
display: block;
}

/*
Page Title
*/
Expand Down

0 comments on commit b0443e5

Please sign in to comment.