Fix: make smoothscroll work with markdown links & update broken links (glossary) #234

Merged
Wick merged 5 commits from fix-glossary into master 2019-01-25 19:05:35 +01:00
Wick commented 2019-01-25 12:23:00 +01:00 (Migrated from github.com)

Fixes #216
Use link format [SPV](#spv) instead of [[SPV]] since same page linking is case sensitive. This link format now also enables smooth scrolling with working browser history for same page links.

Fixes #216 Use link format ```[SPV](#spv)``` instead of ```[[SPV]]``` since same page linking is case sensitive. This link format now also enables smooth scrolling with working browser history for same page links.
tzarebczan commented 2019-01-25 12:35:35 +01:00 (Migrated from github.com)

Thanks for the PR @Wick, we'll get a review on it!! Can we send you some appreciation for your effort?

Thanks for the PR @Wick, we'll get a review on it!! Can we send you [some appreciation](https://LBRY.io/faq/appreciation) for your effort?
NetOpWibby (Migrated from github.com) requested changes 2019-01-25 18:02:06 +01:00
@ -43,4 +41,1 @@
event.target.parentElement.className === "api__toc__item" ||
event.target.parentElement.parentElement.className === "component--glossary-toc"
) history.replaceState({}, "", `#${element}`);
});
NetOpWibby (Migrated from github.com) commented 2019-01-25 18:00:59 +01:00

Does removing this block affect other pages? For example, if I click a glossary link from the Overview page, will the smooth scroll and anchoring happen?

Does removing this block affect other pages? For example, if I click a glossary link from the Overview page, will the smooth scroll and anchoring happen?
NetOpWibby (Migrated from github.com) commented 2019-01-25 18:01:40 +01:00

I'm not sure how to checkout your branch to test myself.

I'm not sure how to checkout your branch to test myself.
NetOpWibby (Migrated from github.com) reviewed 2019-01-25 19:01:15 +01:00
@ -43,4 +41,1 @@
event.target.parentElement.className === "api__toc__item" ||
event.target.parentElement.parentElement.className === "component--glossary-toc"
) history.replaceState({}, "", `#${element}`);
});
NetOpWibby (Migrated from github.com) commented 2019-01-25 19:01:15 +01:00

@Wick ^

@Wick ^
Wick (Migrated from github.com) reviewed 2019-01-25 19:04:46 +01:00
@ -43,4 +41,1 @@
event.target.parentElement.className === "api__toc__item" ||
event.target.parentElement.parentElement.className === "component--glossary-toc"
) history.replaceState({}, "", `#${element}`);
});
Wick (Migrated from github.com) commented 2019-01-25 19:04:46 +01:00

Tested on the overview page + api page and it smooth scrolls as it should and updates the URL. My reasoning behind the change was that if it manages to successfully find an element to scroll to it can safely be added to browser history.

I noticed a related issue though: that when smooth-scrolling occurs it wont get properly placed in browser history, on current site as well (navigate with the sidebar then click back in the browser).
My latest commit will fix this by changing from history.replaceState to history.pushState for updating browser history.

Let me know if you need anything more :)

Tested on the overview page + api page and it smooth scrolls as it should and updates the URL. My reasoning behind the change was that if it manages to successfully find an element to scroll to it can safely be added to browser history. I noticed a related issue though: that when smooth-scrolling occurs it wont get properly placed in browser history, on current site as well (navigate with the sidebar then click back in the browser). My latest commit will fix this by changing from history.replaceState to history.pushState for updating browser history. Let me know if you need anything more :)
NetOpWibby (Migrated from github.com) reviewed 2019-01-25 19:05:22 +01:00
@ -43,4 +41,1 @@
event.target.parentElement.className === "api__toc__item" ||
event.target.parentElement.parentElement.className === "component--glossary-toc"
) history.replaceState({}, "", `#${element}`);
});
NetOpWibby (Migrated from github.com) commented 2019-01-25 19:05:22 +01:00

Sweet, sounds good to me. Thanks!

Sweet, sounds good to me. Thanks!
NetOpWibby (Migrated from github.com) approved these changes 2019-01-25 19:05:28 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry.tech#234
No description provided.