Attention une mise à jour du service Gitlab va être effectuée le mardi 14 décembre entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 91348145 authored by Mikaël Salson's avatar Mikaël Salson Committed by Mathieu Giraud
Browse files

js/segmenter.js: Removing duplicate code with updateElem

Seen with @RyanHerb code is duplicated with updateElem. We just put it in one
function and call that function in the other one.
parent 7d812343
......@@ -500,30 +500,7 @@ Segment.prototype = {
* @param {integer[]} list - array of clone index
* */
updateElem: function (list) {
for (var i = 0; i < list.length; i++) {
if (this.m.clone(list[i]).isSelected()) {
if (document.getElementById("seq" + list[i])) {
var spanF = document.getElementById("f" + list[i]);
this.div_elem(spanF, list[i]);
var spanM = document.getElementById("m" + list[i]);
spanM.innerHTML = this.sequence[list[i]].toString(this);
} else {
this.addToSegmenter(list[i]);
this.show();
}
} else {
if (document.getElementById("seq" + list[i])) {
var element = document.getElementById("seq" + list[i]);
element.parentNode.removeChild(element);
delete this.sequence[list[i]];
}
}
}
this.updateAlignmentButton()
//this.updateSegmenterWithHighLighSelection();
this.updateStats();
this.updateElemStyle(list);
},
removeGermline:function(id){
......@@ -550,12 +527,14 @@ Segment.prototype = {
* @param {integer[]} list - array of clone index
* */
updateElemStyle: function (list) {
for (var i = 0; i < list.length; i++) {
if (this.m.clone(list[i]).isSelected()) {
if (document.getElementById("seq" + list[i])) {
var spanF = document.getElementById("f" + list[i]);
this.div_elem(spanF, list[i]);
var spanM = document.getElementById("m" + list[i]);
spanM.innerHTML = this.sequence[list[i]].toString(this);
} else {
this.addToSegmenter(list[i]);
this.show();
......@@ -564,13 +543,14 @@ Segment.prototype = {
if (document.getElementById("seq" + list[i])) {
var element = document.getElementById("seq" + list[i]);
element.parentNode.removeChild(element);
delete this.sequence[list[i]];
}
}
}
this.updateAlignmentButton()
//this.updateSegmenterWithHighLighSelection();
this.updateStats();
this.updateStats();
},
/**
......
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