commit a2d9d9ec318b990e73e768123d61edc2d226527a Author: Damian Johnson atagar@torproject.org Date: Thu Jul 27 12:02:21 2017 -0700
Show tab containing requested anchor
When the page is loaded with an anchor tag we should show that tab's content so it... well, works. --- web/index.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/web/index.html b/web/index.html index 981603e..4f4dc4a 100644 --- a/web/index.html +++ b/web/index.html @@ -169,10 +169,22 @@ </div> </div>
- <!-- activate tabs with JavaScript --> <script> $(function() { - $(".tabs").tabs(".panes > .content", { history: true }); + $(".tabs").tabs(".panes > .content", { history: true }); + + // when provided an anchor select the tab it resides within + + var anchor = window.location.hash; + var tabs = $(".tabs").data("tabs"); + + if ($("#home").find(anchor).length) { + tabs.click("home"); + } else if ($("#faq").find(anchor).length) { + tabs.click("faq"); + } else if ($("#download").find(anchor).length) { + tabs.click("download"); + } }); </script> </body>
tor-commits@lists.torproject.org