Commit 8865b8aa authored by Thonier Florian's avatar Thonier Florian

semgenter; default value of first_clone is -1

link to #2041
parent 5331ba69
......@@ -61,7 +61,7 @@ function Segment(id, model, database) {
this.starPath = "M 0,6.1176482 5.5244193, 5.5368104 8.0000008,0 10.172535,5.5368104 16,6.1176482 11.406183,9.9581144 12.947371,16 8.0000008,12.689863 3.0526285,16 4.4675491,10.033876 z";
this.cgi_address = CGI_ADDRESS
this.m = model
this.first_clone = 0 ; // id of sequence at the top of the segmenter
this.first_clone = -1 ; // id of sequence at the top of the segmenter
this.memtab = [];
this.sequence = {};
this.is_open = false;
......@@ -718,6 +718,7 @@ Segment.prototype = {
if (previous_li && previous_li.length === 0 ) {
if (cloneID == undefined){
this.set_first_clone( -1 )
return
}
this.set_first_clone( cloneID )
......@@ -1391,6 +1392,7 @@ genSeq.prototype= {
var ref = '';
var seq = '';
if (this.segmenter.amino) {
seq = this.seqAA;
ref = this.segmenter.sequence[this.segmenter.first_clone].seqAA;
......
......@@ -11,8 +11,8 @@ QUnit.test("segmenter", function(assert) {
m.initClones()
var segment = new Segment("segment", m);
assert.equal(segment.first_clone, -1, "segment.first_clone is set to -1 at init")
segment.init()
assert.equal(segment.first_clone, 0, "segment.first_clone is set to 0 at init")
//select test
m.select(0)
......@@ -34,7 +34,7 @@ QUnit.test("segmenter", function(assert) {
assert.equal(document.getElementById("f0"), null, "unselect : Ok")
assert.equal(document.getElementById("f1"), null, "unselect : Ok")
assert.equal(document.getElementById("f2"), null, "unselect : Ok")
assert.equal(segment.first_clone, 0, "segment.first_clone is set to 0 when no clones are selected")
assert.equal(segment.first_clone, -1, "segment.first_clone is set to -1 when no clones are selected")
m.select(0);
m.select(2);
......
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