Skip to content

Commit daf6b06

Browse files
committed
Use details tag for method toggling
1 parent 86039f9 commit daf6b06

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

lib/rdoc/generator/template/darkfish/class.rhtml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@
109109
gsub(/(.*)[-=]>/, '\1→') %>
110110
</span>
111111
<%- if i == 0 and method.token_stream then -%>
112-
<span class="method-click-advice">Toggle source</span>
112+
<div class="method-controls">
113+
<details class="method-click-advice">
114+
<summary>Source</summary>
115+
</details>
116+
</div>
113117
<%- end -%>
114118
</div>
115119
<%- end -%>
@@ -119,10 +123,14 @@
119123
</div>
120124
<%- else -%>
121125
<div class="method-heading">
122-
<span class="method-name"><%= h method.name %></span><span
123-
class="method-args"><%= h method.param_seq %></span>
126+
<span class="method-name"><%= h method.name %></span>
127+
<span class="method-args"><%= h method.param_seq %></span>
124128
<%- if method.token_stream then -%>
125-
<span class="method-click-advice">Toggle source</span>
129+
<div class="method-controls">
130+
<details class="method-click-advice">
131+
<summary>Source</summary>
132+
</details>
133+
</div>
126134
<%- end -%>
127135
</div>
128136
<%- end -%>

lib/rdoc/generator/template/darkfish/css/rdoc.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ main .method-click-advice {
630630
position: absolute;
631631
top: 2px;
632632
right: 0px;
633-
font-size: 12px;
634633
padding-right: 20px;
635634
line-height: 20px;
636635
color: var(--secondary-color);
@@ -739,6 +738,15 @@ main .attribute-access-type {
739738
overflow-x: auto;
740739
white-space: nowrap;
741740
}
741+
742+
.method-controls {
743+
position: static;
744+
}
745+
746+
main .method-click-advice {
747+
position: static;
748+
display: inline-block;
749+
}
742750
}
743751
/* @end */
744752

0 commit comments

Comments
 (0)