Commit 8b6d7c24 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

Merge branch 'feature-c/4298-error-if-only-one-sample' into 'dev'

Resolve "Erreur si aucun clone présent à l'ouverture d'une analyse."

Closes #4298

See merge request !712
parents 84c76bf0 c0defd95
Pipeline #150020 passed with stages
in 7 minutes and 52 seconds
...@@ -385,7 +385,7 @@ Graph.prototype = { ...@@ -385,7 +385,7 @@ Graph.prototype = {
elem[0].classList.remove("graph_listElem_selected") elem[0].classList.remove("graph_listElem_selected")
} }
// Add css rule to current timepoint (and if at least one is show) // Add css rule to current timepoint (and if at least one is show)
if (time != undefined && this.m.samples.order.length != 0){ if (time != undefined && this.m.samples.order.length > 1){
elem = document.getElementById(this.id +'_listElem_text_'+time) elem = document.getElementById(this.id +'_listElem_text_'+time)
elem.classList.add("graph_listElem_selected") elem.classList.add("graph_listElem_selected")
} }
...@@ -445,9 +445,9 @@ Graph.prototype = { ...@@ -445,9 +445,9 @@ Graph.prototype = {
*/ */
updateCountActiveSample: function(){ updateCountActiveSample: function(){
var div = document.getElementById(this.id +"_title") var div = document.getElementById(this.id +"_title")
if (this.m.samples.number != 0 && this.m.samples.number != undefined){ if (this.m.samples.number > 1 && this.m.samples.number != undefined){
div.textContent = ""+this.m.samples.order.length+" / " + this.m.samples.number div.textContent = ""+this.m.samples.order.length+" / " + this.m.samples.number
} else { } else if (this.m.samples.number == 0 && this.m.samples.number != undefined){
// If no sample in the model // If no sample in the model
div.textContent = "..." div.textContent = "..."
} }
...@@ -509,7 +509,9 @@ Graph.prototype = { ...@@ -509,7 +509,9 @@ Graph.prototype = {
speed = typeof speed !== 'undefined' ? speed : 500; speed = typeof speed !== 'undefined' ? speed : 500;
this.updateListElemSelected(); this.updateListElemSelected();
this.updateCountActiveSample(); this.updateCountActiveSample();
if (this.m.samples.number > 1){
this.updateList() this.updateList()
}
this.g_clone = this.clones_container.selectAll("path") this.g_clone = this.clones_container.selectAll("path")
.data(this.data_clone); .data(this.data_clone);
......
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