Closed gedankenstuecke closed 7 years ago
This piece of JavaScript can do it:
$(function(){ var hash = window.location.hash; var anchor = $('a[href$="'+hash+'"]'); if (anchor.length > 0){ anchor.click(); } });
Essentially it checks whether there's a hash in the URL and then 'clicks' the tab for the user. With Firefox's JavaScript Scratchpad it works, will send a PR later
Ok, looking forward to see that PR! (Tried briefly on my end and it seems to get stuck in an endless loop on Chrome when I just c&p it into application.js
).
Done with latest PR
Linking to specific tabs doesn't work right now. E.g.
https://opensnp.org/snps/rs7903146#plos
should take you to the PLOS-paper tab, but that doesn't work.Same is true for linking to a users personal message page: We're trying to link back to a user's inbox at
https://opensnp.org/users/1#messages
after sending a message in themessage_controller
but that fails right now. Seems some JS there isn't working as it's supposed to.