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

Unified Diff: dashboard/ui/js/common.js

Issue 11184003: Added support for trace params to MakeURL. This fixes an issue where the trace= url parameter was s… (Closed) Base URL: http://git.chromium.org/chromium/tools/perf.git@master
Patch Set: Removed extra line Created 8 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/ui/js/common.js
diff --git a/dashboard/ui/js/common.js b/dashboard/ui/js/common.js
index d2daebb509a00ffcd3c8ebdb0ef0b8d1b1acd185..b728f5f12bb4bedc0ad4757654743b8ff563a878 100644
--- a/dashboard/ui/js/common.js
+++ b/dashboard/ui/js/common.js
@@ -85,15 +85,18 @@ function ParseParams() {
// Creates the URL constructed from the current pathname and the given params.
function MakeURL(params) {
- var url = window.location.pathname;
- var sep = '?';
- for (p in params) {
- if (!p)
- continue;
- url = url + sep + p + '=' + params[p];
- sep = '&';
+ var arr = [];
+ for (var p in params) {
+ if (typeof params[p] == 'object') {
+ // Repeated params, stored as hash like {valueA: 1, valueB: 1}
+ for (var r in params[p]) {
+ arr.push(p + '=' + r);
+ }
+ } else {
+ arr.push(p + '=' + params[p]);
+ }
}
- return url;
+ return window.location.pathname + '?' + arr.join('&');
}
// Returns a string describing an object, recursively. On the initial call,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698