1. Odd Simon Simonsen
  2. trac-rpc-mq

Commits

Olemis Lang  committed 9689e60

All tabs synchronized in RPC docs UI.

  • Participants
  • Parent commits 183f38f
  • Branches default

Comments (0)

Files changed (1)

File t5437/t5437-protocol_api-r7194.diff

View file
 diff --git a/trunk/tracrpc/templates/xmlrpclist.html b/trunk/tracrpc/templates/xmlrpclist.html
 --- a/trunk/tracrpc/templates/xmlrpclist.html
 +++ b/trunk/tracrpc/templates/xmlrpclist.html
-@@ -7,23 +7,78 @@
+@@ -7,23 +7,95 @@
    <xi:include href="layout.html" />
    <xi:include href="macros.html" />
    <head>
 -    <title>XML-RPC</title>
 +    <title>RPC</title>
++    <script type="text/javascript">
++      <py:choose test="rpc.proto_id">
++        <py:when test="None"> <!--! unknown protocol -->
++          var seltab = undefined;
++        </py:when>
++        <py:otherwise> <!--! selected protocol -->
++          var seltab = ${[x[0] for x in rpc.protocols].index(rpc.proto_id)};
++        </py:otherwise>
++      </py:choose>
++    </script>
    </head>
 +  
 +  <!--! Display tabs for protocol handlers -->
 +  <py:def function="tabs(divid)">
 +    <script type="text/javascript">
-+      <py:choose test="rpc.proto_id">
-+        <py:when test="None"> <!--! no protocol -->
-+  		    $('#$divid').tabs();
-+  		  </py:when>
-+        <py:otherwise> <!--! selected protocol -->
-+  		    $('#$divid').tabs({selected: ${[x[0] for x in rpc.protocols].index(rpc.proto_id)} });
-+        </py:otherwise>
-+      </py:choose>
++      tab_opts = {
++                    select: function(event, tab) { 
++                                if (tab.index != seltab) {
++                                    seltab = tab.index;
++  	                                $('.ui-tabs-nav').each(
++  	                                  function () {
++  	                                      $(this).tabs("select", tab.index);
++                                        });
++                                  }
++                              }
++                    };
++      <py:if test="rpc.proto_id is not None"> <!--! selected protocol -->
++		    tab_opts.selected = seltab;
++		  </py:if>
++		  $('#$divid').tabs(tab_opts);
 +    </script>
 +  </py:def>
 +
            <dt>
              <h3 id="${'xmlrpc.' + to_unicode(namespace.namespace)}">
                ${namespace.namespace} - ${namespace.description}
-@@ -50,60 +105,6 @@
+@@ -50,60 +122,6 @@
          </dl>
        </div>