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 sidebar on small screens when button is clicked #10409

Closed
TildaDares opened this issue Oct 23, 2021 · 14 comments · Fixed by #10482
Closed

Hide sidebar on small screens when button is clicked #10409

TildaDares opened this issue Oct 23, 2021 · 14 comments · Fixed by #10482
Assignees
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet JavaScript

Comments

@TildaDares
Copy link
Member

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">

@TildaDares TildaDares added bug the issue is regarding one of our programs which faces problems when a certain task is executed JavaScript fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet labels Oct 23, 2021
@ShivamJhaa
Copy link
Contributor

Hey @TildaDares Can I work on this issue?

@TildaDares
Copy link
Member Author

Sure @ShivamJhaa

@ShivamJhaa
Copy link
Contributor

Hello @TildaDares , I have a small doubt
" #sidebar .hidden-sm,
#sidebar .hidden-md {
display: block !important;
} "
I only need to add this in style.css, or something else?

@TildaDares
Copy link
Member Author

Hi @ShivamJhaa, have you tried using that style and it worked?

@TildaDares
Copy link
Member Author

@ShivamJhaa I think the reason why the .hidden-sm, .hidden-md classes don't work is because bootstrap removed them https://getbootstrap.com/docs/4.1/migration/#responsive-utilities

@ShivamJhaa
Copy link
Contributor

Hi @ShivamJhaa, have you tried using that style and it worked?

I am using gitpod so I am not able to test this.

@ShivamJhaa
Copy link
Contributor

@ShivamJhaa I think the reason why the .hidden-sm, .hidden-md classes don't work is because bootstrap removed them https://getbootstrap.com/docs/4.1/migration/#responsive-utilities

So do I have to replace them with "d-sm-block, d-md-block"?

@TildaDares
Copy link
Member Author

@ShivamJhaa I'm not familiar with gitpod but there should be a way to view your changes on the browser or you can just tweak the CSS with Chrome dev tools.

@ShivamJhaa
Copy link
Contributor

@TildaDares PTAL

@TildaDares
Copy link
Member Author

TildaDares commented Nov 4, 2021

Thank you for teaching me something new @ShivamJhaa. I didn't know PTAL means Please Take Another Look 😅

@ShivamJhaa
Copy link
Contributor

Thank you for teaching me something new @ShivamJhaa. I didn't know PTAL means Please Take Another Look sweat_smile

Your welcome.

@KarishmaVanwari
Copy link
Contributor

Can I take up this issue, if it is still open? @TildaDares

@TildaDares
Copy link
Member Author

Hi @KarishmaVanwari, there’s a PR open for this already. Thanks!

@KarishmaVanwari
Copy link
Contributor

Hi @KarishmaVanwari, there’s a PR open for this already. Thanks!

Okay

Tlazypanda pushed a commit that referenced this issue Nov 27, 2021
…10482)

* Fixed: Hide sidebar on small screens when button is clicked #10409

* Fixed: Hide sidebar on small screens when button is clicked #10409

* Fixed 10409 : Hide sidebar on small screens when button is clicked

* Update sidebar.js

* Updated

* Updated

* Updated

* Update sidebar.js
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
…#10409 (publiclab#10482)

* Fixed: Hide sidebar on small screens when button is clicked publiclab#10409

* Fixed: Hide sidebar on small screens when button is clicked publiclab#10409

* Fixed 10409 : Hide sidebar on small screens when button is clicked

* Update sidebar.js

* Updated

* Updated

* Updated

* Update sidebar.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet JavaScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants