Commit daa87f41 authored by Armand Bour's avatar Armand Bour Committed by Mathieu Giraud
Browse files

Implement refresh func on model/graph/scatter/list

parent c2290ec8
......@@ -1377,6 +1377,12 @@ Graph.prototype = {
})
return this
},
shouldRefresh: function() {
this.init();
this.update();
this.resize();
}
......@@ -1440,38 +1446,13 @@ Stack.prototype = {
}
}
}
//other
for (j=0; j<this.m.samples.number; j++){
this.min[this.m.clones.length-1][j] = this.sum[j]
this.sum[this.m.clones.length-1] += this.m.clone(this.m.clones.length-1).getSize(j)
this.max[this.m.clones.length-1][j] = this.sum[j]
}
}
}
}
......@@ -900,6 +900,10 @@ List.prototype = {
},
shouldRefresh: function () {
this.init();
this.update();
}
} //fin prototype
List.prototype = $.extend(Object.create(View.prototype), List.prototype);
......
......@@ -2341,8 +2341,7 @@ changeCloneNotation: function(cloneNotationType) {
bodyNode.style.cursor = "default";
}
};
$.ajax(url, {
var params = {
method: "POST",
data: {
sequences: sequences
......@@ -2353,12 +2352,16 @@ changeCloneNotation: function(cloneNotationType) {
console.log({ msg: data.error, type: "flash", priority: 2 });
return;
}
var index = self.clones.length;
data.clones.forEach(function (clone) {
clone.quantifiable = false;
var clone = new Clone(clone, self, index);
self.mapID[clone.id] = index;
index++;
});
self.parseJsonData(data, 100);
self.loadGermline();
self.initClones();
self.shouldRefresh();
console.log({ msg: "Clone(s) added!", type: "flash", priority: 1 })
},
error: function (xhr, textStatus, errorThrown) {
......@@ -2366,10 +2369,19 @@ changeCloneNotation: function(cloneNotationType) {
console.log({ msg: textStatus + " " + errorThrown, type: "flash", priority: 2 });
},
timeout: 60000
});
};
$.ajax(url, params);
displayAjax(true);
}
}
}
},
shouldRefresh: function () {
this.view.forEach(function (view) {
if (view.shouldRefresh) {
view.shouldRefresh();
}
});
},
}; //end prototype Model
......@@ -2160,5 +2160,10 @@ ScatterPlot.prototype = {
},
shouldRefresh: function () {
this.init();
this.update();
this.resize();
}
}
ScatterPlot.prototype = $.extend(Object.create(View.prototype), ScatterPlot.prototype);
\ No newline at end of file
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