[tor-commits] [nyx/master] Iterate over panes rather than hardcoded list

atagar at torproject.org atagar at torproject.org
Sat Aug 5 01:18:26 UTC 2017


commit 15c8fe553bf1402a31246787648f706af35bc7b9
Author: Damian Johnson <atagar at torproject.org>
Date:   Thu Jul 27 21:10:20 2017 -0700

    Iterate over panes rather than hardcoded list
---
 web/index.html | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/web/index.html b/web/index.html
index 75ff1e6..55b3263 100644
--- a/web/index.html
+++ b/web/index.html
@@ -188,19 +188,17 @@
 
     <script>
     $(function() {
-      $(".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");
+      $(".tabs").tabs(".panes > .content", { history: true });
+
+      if (anchor) {
+        $(".panes").children().each(function () {
+          if ($(this).find(anchor).length) {
+            $(".tabs").data("tabs").click(this.id);
+          }
+        });
       }
 
       // show/hide for FAQ questions





More information about the tor-commits mailing list