Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2904)

Unified Diff: chrome/common/extensions/docs/server2/static/js/branch.js

Issue 10826173: Extensions Docs Server: Proper path handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698