Commit ee30ddcb authored by flothoni's avatar flothoni

segmenter; put some code into a specific function

This function allow to set if a clone is the 'first clone' of the segmenter
link to #2041
parent 7582cf96
......@@ -670,12 +670,8 @@ Segment.prototype = {
this.sequence[cloneID] = new Sequence(cloneID, this.m, this)
var divParent = document.getElementById("listSeq");
// Am I the first clone in this segmenter ?
var previous_li = divParent.getElementsByTagName("li");
if (previous_li && previous_li.length === 0) {
this.first_clone = cloneID
}
this.update_first_clone(cloneID)
var li = document.createElement('li');
li.id = "seq" + cloneID;
......@@ -699,11 +695,30 @@ Segment.prototype = {
},
/**
* Update the first_clone of the segmenter.
* This one can be changed when we deselect some clone into the segmenter
**/
update_first_clone : function(cloneID) {
var divParent = document.getElementById("listSeq");
// Am I the first clone in this segmenter ?
var previous_li = divParent.getElementsByTagName("li");
if (previous_li && previous_li.length === 0 ) {
if (cloneID == undefined){
return
}
this.first_clone = cloneID
}
},
/**
* select all the germline of a clone .
* add them to the segmenter
**/
add_all_germline_to_segmenter : function() {
for (var id in this.sequence) {
if (this.isClone(id)) {
......
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