Index: chrome/common/extensions/docs/server2/static/js/branch.js |
diff --git a/chrome/common/extensions/docs/server2/static/js/branch.js b/chrome/common/extensions/docs/server2/static/js/branch.js |
index 3efea694089790ac3f453b6a3a2e3072f0173525..f435872927241dd861109234f99d6f04f50834af 100644 |
--- a/chrome/common/extensions/docs/server2/static/js/branch.js |
+++ b/chrome/common/extensions/docs/server2/static/js/branch.js |
@@ -9,12 +9,14 @@ |
return; |
var current_branch = window.bootstrap.branchInfo.current; |
var path = window.location.pathname.split('/'); |
+ if (path[0] == '') |
+ path = path.slice(1); |
var index = path.indexOf(current_branch); |
if (index != -1) |
path[index] = value; |
else |
- path.splice(path.length - 1, 0, value); |
- window.location = path.join('/'); |
+ path.splice(0, 0, value); |
+ window.location = '/' + path.join('/'); |
} |
document.getElementById('branchChooser').addEventListener( |