Skip to content

Hide sidebar on small screens when button is clicked #10409

@TildaDares

Description

@TildaDares

When the chevron-down icon is clicked, the #sidebar section is supposed to be hidden but currently it doesn't work. This only applies to sm and md screens.

Screenshot 2021-10-23 at 09 02 17

You can see a demonstration of this in https://publiclab.org/questions/warren/01-04-2018/how-good-is-the-purpleair-sensor-and-what-does-it-detect

The relevant code needed for this change can be found in

function toggle_sidebar() {
if ($('#sidebar').hasClass('hidden-sm')) {
$('#sidebar').removeClass('hidden-sm')
.removeClass('hidden-xs')
} else {
$('#sidebar').addClass('hidden-sm')
.addClass('hidden-xs')
}
}

<a style="margin-top:-16px;margin-bottom:0;" class="btn btn-sm btn-block btn-link d-lg-none" href="javascript:void()" onClick="toggle_sidebar()"><i class="fa fa-chevron-down"></i></a>
<div id="sidebar" class="d-lg-inline">

Metadata

Metadata

Assignees

Labels

JavaScriptbugthe issue is regarding one of our programs which faces problems when a certain task is executedfto-candidateissues which are meant to be solved by first timers but aren't well-formatted yet

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions