Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 1972bc0a authored by Marc Duez's avatar Marc Duez

model.js : compute available system list

parent 22684c4f
......@@ -430,26 +430,27 @@ Builder.prototype = {
$("#system_menu").css("display", "")
$("#color_system_button").css("display", "")
for (var key in this.m.reads.germline) {
(function (key) {
for (var key in this.m.system_available) {
var system = this.m.system_available[key];
(function (system){
var radio=document.createElement("input");
radio.type="radio";
radio.name="germline";
radio.value=key
if (this.m.germlineV.system==key) radio.checked=true
radio.value=system
if (this.m.germlineV.system==system) radio.checked=true
div = document.createElement('div');
div.onclick = function(){
m.changeGermline(key)
m.changeGermline(system)
}
div.className="buttonSelector"
div.appendChild(radio)
div.appendChild(document.createTextNode(key))
div.appendChild(document.createTextNode(system))
li = document.createElement('li');
li.appendChild(div)
listGermline.appendChild(li);
})(key)
})(system)
}
}else{
......@@ -682,7 +683,7 @@ Builder.prototype = {
var keys = 0 ;
var key_list = Object.keys(this.m.reads.germline);
var key_list = this.m.system_available;
key_list.sort();
for (var k in key_list) {
......
......@@ -277,7 +277,17 @@ Model.prototype = {
self.germlineList.add(self.germlines)
}
self.system_selected = [];
for (var key in self.reads.germline) self.system_selected.push(key)
self.system_available = [];
for (var i = 0; i < this.n_clones; i++) {
var system = this.clone(i).getSystem()
if (typeof system != "undefined" && self.system_available.indexOf(system) ==-1){
self.system_available.push(system)
}
}
for (var key in self.system_available){
var system = this.system_available[key]
self.system_selected.push(system)
}
var germline_list = Object.keys(this.reads.germline)
if (germline_list.length >1) {
......@@ -381,7 +391,7 @@ Model.prototype = {
loadGermline: function (system) {
console.log("loadGermline : " + system)
system = typeof system !== 'undefined' ? system : this.system;
if (system == "multi") system = Object.keys(this.reads.germline)[0]
if (system == "multi") system = this.system_available[0]
return this.germlineV.load(system, "V", this)
.germlineD.load(system, "D", this)
......@@ -724,9 +734,10 @@ Model.prototype = {
this.system_selected = []
//check system currently selected in menu
for (var key in this.reads.germline) {
if (document.getElementById("checkbox_system_"+key).checked){
this.system_selected.push(key)
for (var key in this.system_available) {
var system = this.system_available[key]
if (document.getElementById("checkbox_system_"+system).checked){
this.system_selected.push(system)
}
}
......
......@@ -819,8 +819,9 @@ ScatterPlot.prototype = {
var w = this.resizeW*0.2
//compute hidden position for unactivated germline (to avoid firework effect)
for (var key in this.m.reads.germline){
this.systemGrid[key] = { 'x' : 0.99 , 'y' : 0.99}
for (var key in this.m.system_available){
var system = this.m.system_available[key]
this.systemGrid[system] = { 'x' : 0.99 , 'y' : 0.99}
}
//compute position for selected germline
......
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