Commit 9881d73c authored by Ryan Herbert's avatar Ryan Herbert Committed by Mathieu Giraud

refactor applyUrlParams to delegate to url.js

parent 7b9d893d
......@@ -87,6 +87,7 @@ try {
var shortcut = new Shortcut(m)
var url = new Url(m);
m.url_manager = url;
//TODO
initMenu();
......
......@@ -2637,17 +2637,5 @@ changeAlleleNotation: function(alleleNotation) {
});
},
applyUrlParams:function(params_dict) {
if (typeof params_dict.clone!== "undefined" && params_dict.clone !== '') {
this.multiSelect(params_dict.clone);
}
if (typeof params_dict.plot!== "undefined" && params_dict.plot !== '') {
this.sp.splitX = params_dict.plot[0];
this.sp.splitY = params_dict.plot[1];
this.sp.mode = params_dict.plot[2];
}
},
}; //end prototype Model
......@@ -536,6 +536,7 @@ Model_loader.prototype = {
for (var key in this.analysis.data)
this.data[key] = this.analysis.data[key]
}
this.applyUrlParams();
this.initClones();
this.initData();
......@@ -826,6 +827,10 @@ Model_loader.prototype = {
}
}
this.average_quality = this.average_quality/count;
}
},
applyUrlParams:function() {
this.url_manager.applyURL();
},
};
......@@ -78,8 +78,25 @@ Url.prototype= {
},
updateModel:function() {
applyURL : function() {
var straight_params = this.getStraightParams();
for (var i = 0; i < straight_params.length; i++) {
this.m[straight_params[i]] = this.url_dict[straight_params[i]];
}
if (typeof this.url_dict.clone !== "undefined") {
var clones = this.url_dict.clone.split(',');
for (var j = 0; j < clones.length; j++) {
var c = this.m.clone(clones[j]);
if (!c.isVirtual()) {
c.select = true;
}
}
}
if (typeof this.url_dict.plot !== "undefined") {
var sp_params = this.url_dict.plot.split(',');
this.sp.changeSplitMethod(sp_params[0], sp_params[1], sp_params[2]);
}
},
parseUrlParams:function (urlparams) {
......@@ -95,4 +112,8 @@ Url.prototype= {
return params
},
getStraightParams: function() {
return ["sample_set_id", "patient_id", "run_id", "config"];
}
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment