Skip to content

Commit

Permalink
Add jump-to-top link
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed Feb 5, 2011
1 parent 897119b commit 99f7210
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/rdoc/generator/template/darkfish/classpage.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript" charset="utf-8"></script>

</head>
<body class="<%= klass.type %>">
<body id="top" class="<%= klass.type %>">

<div id="metadata">
<div id="home-metadata">
Expand Down Expand Up @@ -176,9 +176,12 @@
</div><!-- description -->

<% klass.each_section do |section, constants, attributes| %>
<div id="<%= section.aref %>">
<div id="<%= section.aref %>" class="documentation-section">
<% if section.title then %>
<h2 class="section-header"><%= section.title %></h2>
<h2 class="section-header">
<%= section.title %>
<a href="#top">&uarr; top</a>
</h2>
<% end %>

<% if section.comment then %>
Expand Down
17 changes: 17 additions & 0 deletions lib/rdoc/generator/template/darkfish/rdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,23 @@ ul.link-list .type {
color: #666;
}

.documentation-section h2 {
position: relative;
}

.documentation-section h2 a {
position: absolute;
top: 8px;
right: 10px;
font-size: 12px;
color: #9b9877;
visibility: hidden;
}

.documentation-section h2:hover a {
visibility: visible;
}

/* @group Method Details */

#documentation .method-source-code {
Expand Down

0 comments on commit 99f7210

Please sign in to comment.