Commit 4410a04e authored by Ryan Herbert's avatar Ryan Herbert Committed by Mathieu Giraud

database.js refactor load_data no url pushing

We only want url.js to perform a location.pushState, so instead, we will
set the values we want to keep in the model so url.js will be able to
update the url correctly
parent e5070201
......@@ -732,13 +732,16 @@ Database.prototype = {
return
}
var url = document.documentURI.split('?')[0]
var new_location;
if (typeof args.sample_set_id != "undefined")
new_location = url+"?sample_set_id="+args.sample_set_id+"&config="+args.config
if (typeof args.patient != "undefined")
new_location = url+"?patient="+args.patient+"&config="+args.config
window.history.pushState('plop', 'plop', new_location);
if (typeof args.sample_set_id != "undefined") {
this.m.sample_set_id = args.sample_set_id
} else if (typeof args.patient != "undefined") {
this.m.patient_id = args.patient
} else if (typeof args.run_id !== "undefined") {
this.m.run_id = args.run_id
}
if(typeof args.config !== "undefined") {
this.m.config = args.config;
}
$.ajax({
type: "POST",
......@@ -794,17 +797,15 @@ Database.prototype = {
console.log("db : custom data "+list)
var url = document.documentURI.split('?')[0]
var arg = "?" + this.argsToStr(args)
var new_location = url+arg
window.history.pushState('plop', 'plop', new_location);
var arg = this.argsToStr(args)
this.m.custom = arg;
this.m.wait("Comparing samples...")
$.ajax({
type: "POST",
timeout: DB_TIMEOUT_GET_CUSTOM_DATA,
crossDomain: true,
url: self.db_address + "default/get_custom_data" + arg,
url: self.db_address + "default/get_custom_data?" + arg,
xhrFields: {withCredentials: true},
success: function (result) {
self.m.resume()
......
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