mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
godoc: fix inline playground width for mobile devices
The inline playground had a fixed width due to which it gets partially hidden on mobile devices. Hence, expanding the div to fit the entire screen properly inside the media query for mobile resolutions. Also, since the playground appears on top of the button, there is no way to hide it except to reload the page. So, added a click handler on the page to hide the playground if it is open. Fixes golang/go#21636 Change-Id: Id15caec25e870e9ff3be7736e2bb1084591d1016 Reviewed-on: https://go-review.googlesource.com/c/129435 Reviewed-by: Andrew Bonventre <andybons@golang.org> Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
3bba456143
commit
4fd3307906
@ -150,6 +150,15 @@ function setupDropdownPlayground() {
|
||||
div.hide();
|
||||
});
|
||||
$('#menu').css('min-width', '+=60');
|
||||
|
||||
// Hide inline playground if we click somewhere on the page.
|
||||
// This is needed in mobile devices, where the "Play" button
|
||||
// is not clickable once the playground opens up.
|
||||
$("#page").click(function() {
|
||||
if (button.hasClass('active')) {
|
||||
button.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setupInlinePlayground() {
|
||||
|
File diff suppressed because one or more lines are too long
@ -763,6 +763,11 @@ a.error {
|
||||
font-size: 0.9375rem;
|
||||
}
|
||||
|
||||
div#playground {
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
pre,
|
||||
code {
|
||||
font-size: 0.866rem;
|
||||
|
Loading…
x
Reference in New Issue
Block a user