Skip to content

Commit 08c0299

Browse files
committed
Rollup merge of rust-lang#24797 - roryokane:patch-1, r=nikomatsakis
The minus sign ‘−’ is the same width as the plus sign ‘+’, so the button’s transition between the two symbols will look slightly smoother. If you don’t want to use literal Unicode characters, I can change ‘−’ to `\u2212`. I’m not starting with that suggestion because ‘−’ is easier to read and understand, and if I used `\u2212`, it would probably be necessary to also comment the usage on each line to explain what character is being used.
2 parents 5c60145 + 72e8f7b commit 08c0299

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/librustdoc/html/render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ impl<'a> fmt::Display for Item<'a> {
14601460
try!(write!(fmt, "<span class='out-of-band'>"));
14611461
try!(write!(fmt,
14621462
r##"<span id='render-detail'>
1463-
<a id="toggle-all-docs" href="#" title="collapse all docs">[-]</a>
1463+
<a id="toggle-all-docs" href="#" title="collapse all docs">[&minus;]</a>
14641464
</span>"##));
14651465

14661466
// Write `src` tag

src/librustdoc/html/static/main.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -808,20 +808,20 @@
808808

809809
$("#toggle-all-docs").on("click", function() {
810810
var toggle = $("#toggle-all-docs");
811-
if (toggle.html() == "[-]") {
812-
toggle.html("[+]");
811+
if (toggle.html() == "[&minus;]") {
812+
toggle.html("[&plus;]");
813813
toggle.attr("title", "expand all docs");
814814
$(".docblock").hide();
815815
$(".toggle-label").show();
816816
$(".toggle-wrapper").addClass("collapsed");
817-
$(".collapse-toggle").children(".inner").html("+");
817+
$(".collapse-toggle").children(".inner").html("&plus;");
818818
} else {
819-
toggle.html("[-]");
819+
toggle.html("[&minus;]");
820820
toggle.attr("title", "collapse all docs");
821821
$(".docblock").show();
822822
$(".toggle-label").hide();
823823
$(".toggle-wrapper").removeClass("collapsed");
824-
$(".collapse-toggle").children(".inner").html("-");
824+
$(".collapse-toggle").children(".inner").html("&minus;");
825825
}
826826
});
827827

@@ -835,20 +835,20 @@
835835
if (relatedDoc.is(":visible")) {
836836
relatedDoc.slideUp({duration:'fast', easing:'linear'});
837837
toggle.parent(".toggle-wrapper").addClass("collapsed");
838-
toggle.children(".inner").html("+");
838+
toggle.children(".inner").html("&plus;");
839839
toggle.children(".toggle-label").fadeIn();
840840
} else {
841841
relatedDoc.slideDown({duration:'fast', easing:'linear'});
842842
toggle.parent(".toggle-wrapper").removeClass("collapsed");
843-
toggle.children(".inner").html("-");
843+
toggle.children(".inner").html("&minus;");
844844
toggle.children(".toggle-label").hide();
845845
}
846846
}
847847
});
848848

849849
$(function() {
850850
var toggle = $("<a/>", {'href': 'javascript:void(0)', 'class': 'collapse-toggle'})
851-
.html("[<span class='inner'>-</span>]");
851+
.html("[<span class='inner'>&minus;</span>]");
852852

853853
$(".method").each(function() {
854854
if ($(this).next().is(".docblock") ||

0 commit comments

Comments
 (0)