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

Deep links load content hidden underneath our menu bar and ribbon #2093

Closed
ebarry opened this issue Jan 24, 2018 · 2 comments
Closed

Deep links load content hidden underneath our menu bar and ribbon #2093

ebarry opened this issue Jan 24, 2018 · 2 comments
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute JavaScript

Comments

@ebarry
Copy link
Member

ebarry commented Jan 24, 2018

Please describe the problem (or idea)

What happened just before the problem occurred?

I clicked the timestamp to a particular comment i needed to link to, and it created this URL that loaded the content so high that it was completely hidden under the menu bar or the ribbon. Luckily, I knew what i was expecting to see , so i knew to scroll up to find it, but someone who doesn't know what to expect when clicking the link could get completely confused because of this.

What did you expect to see that you didn't?

I expected to see the top of the content i linked to.

Please show us where to look

https://publiclab.org/questions/warren/11-14-2017/what-s-one-thing-that-could-be-better-for-newcomers-about-the-public-lab-website#answer-0-comment-17687

Here's an example matching the screenshot below: https://publiclab.org/wiki/public-comment#What+is+Public+Comment?

screenshot 2018-01-24 at 1 16 13 pm

@jywarren
Copy link
Member

We attempted a fix here:

/* window scroll trick for header */
function adjust_anchor_for_banner(offset) {
offset = offset || 50; // how much to scroll to account for the banner
var scroll_pos = $(document).scrollTop()
if (scroll_pos > offset) {
$(document).scrollTop( scroll_pos - offset );
}
}
$(window).load(function() { adjust_anchor_for_banner(); })
$(window).on('hashchange', adjust_anchor_for_banner)

But this isn't great. Would it work if we just increased the "rewind" by... 100+ pixels?

Also, there are at least two ways to get to one of these -- our solution should work for all of them:

@jywarren jywarren added bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute JavaScript labels Jan 24, 2018
@jywarren jywarren changed the title Direct links to comments load content underneath our menu bar and ribbon Deep links load content hidden underneath our menu bar and ribbon Jan 24, 2018
@jywarren
Copy link
Member

Fixed for wiki headings here: #2512 by @patcon -- thanks! 👍 👍 🎉

please test this out!

Related work by @namangupta01 here for Answers: #2146

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 help wanted requires help by anyone willing to contribute JavaScript
Projects
None yet
Development

No branches or pull requests

2 participants