The branch selector now sends you to the correct url
[catagits/Gitalist.git] / root / static / js / site.js
index 076a377..5af7d11 100755 (executable)
@@ -4,7 +4,7 @@ function findPos(obj) {
          do {
                  curleft += obj.offsetLeft;
                  curtop += obj.offsetTop;
-         } 
+         }
          while (obj = obj.offsetParent);
          return [curleft,curtop];
        }
@@ -45,8 +45,9 @@ function uriFor(action, sha1) {
 }
 
 function switchBranch() {
-    var branch = jQuery('#branch-list').val();
-    document.location.href = uriFor('current', branch);
+    var branch = jQuery('#branch-list').val(),
+        action = branch != '...' ? 'current' : 'heads';
+    document.location.href = uriFor(action, encodeURIComponent(branch).replace('/', '%2F'));
 }
 
 function compareDiffs(){