Commit e96e6d5e authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-c/normalization' into 'dev'

normalization : fix tests, show buttons when needed

Closes #3661

See merge request !382
parents f0fdb02a e9d8cf63
Pipeline #57465 passed with stages
in 5 minutes and 58 seconds
...@@ -1361,6 +1361,9 @@ span.warningReads { ...@@ -1361,6 +1361,9 @@ span.warningReads {
#bot-separator:hover { #bot-separator:hover {
background: #fdf6e3; background: #fdf6e3;
} }
#norm_button {
width: 7ex;
}
.edit_button { .edit_button {
float: right; float: right;
margin-right: 2px; margin-right: 2px;
......
...@@ -1561,6 +1561,10 @@ span.warningReads { ...@@ -1561,6 +1561,10 @@ span.warningReads {
background: @highlight; background: @highlight;
} }
#norm_button {
width: 7ex;
}
.edit_button { .edit_button {
float: right; float: right;
margin-right: 2px; margin-right: 2px;
......
...@@ -274,6 +274,8 @@ Model.prototype = { ...@@ -274,6 +274,8 @@ Model.prototype = {
initClones: function () { initClones: function () {
console.log("initClones()"); console.log("initClones()");
var have_external_normalization = false var have_external_normalization = false
$("#external_normalization").hide();
$("#expected_normalization").hide();
// time_type to name_short if there is many samples // time_type to name_short if there is many samples
if (this.samples.order.length > 6) if (this.samples.order.length > 6)
...@@ -312,6 +314,7 @@ Model.prototype = { ...@@ -312,6 +314,7 @@ Model.prototype = {
var radio = document.getElementById("external_normalization_input") var radio = document.getElementById("external_normalization_input")
if (radio != undefined) { if (radio != undefined) {
radio.checked = true; radio.checked = true;
$("#external_normalization").show();
} }
} }
}, //end initClones }, //end initClones
...@@ -1991,6 +1994,7 @@ changeAlleleNotation: function(alleleNotation) { ...@@ -1991,6 +1994,7 @@ changeAlleleNotation: function(alleleNotation) {
span2.appendChild(this.norm_input) span2.appendChild(this.norm_input)
this.norm_button = document.createElement('button'); this.norm_button = document.createElement('button');
this.norm_input.id = "norm_button";
this.norm_button.appendChild(document.createTextNode("ok")) this.norm_button.appendChild(document.createTextNode("ok"))
this.norm_button.onclick = function () { this.norm_button.onclick = function () {
var cloneID = self.cloneID; var cloneID = self.cloneID;
...@@ -1998,13 +2002,13 @@ changeAlleleNotation: function(alleleNotation) { ...@@ -1998,13 +2002,13 @@ changeAlleleNotation: function(alleleNotation) {
if (size>0 && size<1){ if (size>0 && size<1){
self.set_normalization( self.NORM_EXPECTED ) self.set_normalization( self.NORM_EXPECTED )
$("#expected_normalization").show();
self.norm_input.value = "" self.norm_input.value = ""
self.clone(cloneID).expected=size; self.clone(cloneID).expected=size;
self.compute_normalization(cloneID, size) self.compute_normalization(cloneID, size)
self.update() self.update()
$(self.tagSelector).hide('fast') $(self.tagSelector).hide('fast')
document.getElementById("expected_normalization_input").checked = true; $("expected_normalization_input").prop("checked", true)
}else{ }else{
console.log({"type": "popup", "msg": "expected input between 0.0001 and 1"}); console.log({"type": "popup", "msg": "expected input between 0.0001 and 1"});
} }
......
...@@ -161,8 +161,6 @@ QUnit.test("tag/norm", function(assert) { ...@@ -161,8 +161,6 @@ QUnit.test("tag/norm", function(assert) {
assert.equal(m.clone(1).getSize(), 0.1, "size before norm : Ok") assert.equal(m.clone(1).getSize(), 0.1, "size before norm : Ok")
assert.equal(m.clone(2).getSize(), 0.125, "size before norm : Ok") assert.equal(m.clone(2).getSize(), 0.125, "size before norm : Ok")
return; // TMP //
m.norm_input.value = 0.25; m.norm_input.value = 0.25;
m.norm_button.click(); m.norm_button.click();
......
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