Commit 6a5b8235 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

merge -- see clone original name

A feature by @heto.
Closes #903. See merge request !15
parents 85bd3383 4f267519
......@@ -357,6 +357,19 @@ Clone.prototype = {
}
}, //end getCode
/**
* return custom name and segmentation name "<c_name> ( <seg name> )" <br>
* return segmentation name only if there is no custom name
* @return {string} custom name and segmentation name
* */
getNameAndCode: function () {
if (this.c_name) {
return this.c_name + " (" + this.getCode() + ")";
} else {
return this.getCode();
}
}, //end getNameAndCode
/**
* change/add custom name
* @param {string} name
......
......@@ -469,7 +469,7 @@ List.prototype = {
if (typeof span_name == "undefined") return false;
if (typeof span_name == "undefined") console.log(cloneID);
span_name.innerHTML = clone.getShortName();
span_name.title = clone.getName();
span_name.title = clone.getNameAndCode();
span_name.style.color = clone.getColor();
//update star color
......@@ -844,11 +844,3 @@ List.prototype = {
} //fin prototype
List.prototype = $.extend(Object.create(View.prototype), List.prototype);
......@@ -737,7 +737,7 @@ changeCloneNotation: function(cloneNotationType) {
}
$(".focus")
.text(this.clone(cloneID).getName())
.text(this.clone(cloneID).getNameAndCode())
},
......
......@@ -116,6 +116,9 @@ QUnit.test("name, informations, getHtmlInfo", function(assert) {
assert.equal(c3.getSequenceName(), "plop", "changename clone3 : plop");
assert.equal(c1.getNumberNonZeroSamples(), 3, "clone c1, getNumberNonZeroSamples");
assert.equal(c2.getNameAndCode(), some_name, "clone2, .getNameAndCode()");
assert.equal(c3.getNameAndCode(), "plop (id3)", "clone3, .getNameAndCode()");
m.select(0)
m.select(1)
m.merge()
......
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