Skip to content

Commit

Permalink
rustdoc: collapse docblock before showing label
Browse files Browse the repository at this point in the history
  • Loading branch information
euclio committed Apr 7, 2017
1 parent 44855a4 commit 8a1d2a3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,14 +951,21 @@
if (relatedDoc.is(".docblock")) {
if (relatedDoc.is(":visible")) {
if (animate === true) {
relatedDoc.slideUp({duration: 'fast', easing: 'linear'});
toggle.children(".toggle-label").fadeIn();
relatedDoc.slideUp({
duration: 'fast',
easing: 'linear',
complete: function() {
toggle.children(".toggle-label").fadeIn();
toggle.parent(".toggle-wrapper").addClass("collapsed");
toggle.children(".inner").text(labelForToggleButton(true));
},
});
} else {
relatedDoc.hide();
toggle.children(".toggle-label").show();
toggle.parent(".toggle-wrapper").addClass("collapsed");
toggle.children(".inner").text(labelForToggleButton(true));
}
toggle.parent(".toggle-wrapper").addClass("collapsed");
toggle.children(".inner").text(labelForToggleButton(true));
} else {
relatedDoc.slideDown({duration: 'fast', easing: 'linear'});
toggle.parent(".toggle-wrapper").removeClass("collapsed");
Expand Down

0 comments on commit 8a1d2a3

Please sign in to comment.