Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide theme button under menu in mobile mode and fix top margin issue … #48080

Merged
merged 1 commit into from
Feb 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 6 additions & 31 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,9 @@
sidebar.appendChild(div);
}
}
var themeChoices = document.getElementById("theme-choices");
if (themeChoices) {
if (!themesWidth) {
var savedState = themeChoices.style.display;
themeChoices.style.display = 'block';
themesWidth = themeChoices.offsetWidth + 'px';
themeChoices.style.display = savedState;
}
themeChoices.style.position = "fixed";
themeChoices.style.width = themesWidth;
themeChoices.style.top = '78px';
themeChoices.style.left = '250px';
}
document.getElementsByTagName("body")[0].style.marginTop = '45px';
var themePicker = document.getElementById("theme-picker");
if (themePicker) {
themePicker.style.position = "fixed";
themePicker.style.top = "50px";
themePicker.style.left = "250px";
var themePicker = document.getElementsByClassName("theme-picker");
if (themePicker && themePicker.length > 0) {
themePicker[0].style.display = "none";
}
}

Expand All @@ -157,18 +141,9 @@
filler.remove();
}
document.getElementsByTagName("body")[0].style.marginTop = '';
var themePicker = document.getElementById("theme-picker");
if (themePicker) {
themePicker.style.position = "absolute";
themePicker.style.top = null;
themePicker.style.left = null;
}
var themeChoices = document.getElementById("theme-choices");
if (themeChoices) {
themeChoices.style.position = 'absolute';
themeChoices.style.width = null;
themeChoices.style.top = null;
themeChoices.style.left = null;
var themePicker = document.getElementsByClassName("theme-picker");
if (themePicker && themePicker.length > 0) {
themePicker[0].style.display = null;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ span.since {
}

#main {
margin-top: 50px;
margin-top: 45px;
padding: 0;
}

Expand Down