Commit f338002d authored by aurelien beliard's avatar aurelien beliard Committed by Mathieu Giraud
Browse files

correct quality code probleme

parent 75734e34
......@@ -144,10 +144,14 @@ Builder.prototype = {
normalize_list.removeAllChildren();
var input = document.createElement("input");
var label = document.createElement("label")
input.type = "radio";
input.value= -1;
input.name = "normalize_list";
input.id = "reset_norm";
label.for = "reset_norm"
var div = document.createElement("div");
div.appendChild(input);
......@@ -173,33 +177,32 @@ Builder.prototype = {
var id=m.normalization_list[norm].id
var expected_size = m.normalization_list[norm].expected_size
var input_elem = document.createElement("input");
var label_elem = document.createElement("label")
label_elem.setAttribute("for","reset_norm"+m.normalization_list[norm].id);
input_elem.type = "radio";
input_elem.value= -1;
input_elem.name = "normalize_list";
input_elem.id = "reset_norm"+m.normalization_list[norm].id;
console.log(m.normalization_list[norm].id)
var form_div_elem = document.createElement("div");
form_div_elem.className="buttonSelector";
form_div_elem.id = "normalizetest"+id
form_div_elem.dataset.id =id
form_div_elem.dataset.expected_size=expected_size
if (m.normalization.id==id){
input.checked=true;
}
// if (m.normalization.id==id){
// input.checked=true;
// }
text= m.clone(m.normalization_list[norm].id).getShortName()+" "+ m.clone(m.normalization_list[norm].id).getStrSize()
form_div_elem.appendChild(input_elem);
form_div_elem.appendChild(label_elem);
form_div_elem.appendChild(document.createTextNode(text))
form_div_elem.onclick = function() {
self.m.norm_input.value = ""
self.m.clone(this.dataset.id).expected= this.dataset.expected_size;
self.m.compute_normalization(this.dataset.id, this.dataset.expected_size)
self.m.update()
}
form_div_elem.addEventListener('click', self.applyOldnormalization, false);
normalize_list.appendChild(form_div_elem);
tmp_norm_list.push(m.normalization_list[norm].id)
}
......@@ -207,7 +210,14 @@ Builder.prototype = {
}
},
applyOldnormalization:function() {
self.m.norm_input.value = ""
this.firstChild.checked=true;
self.m.clone(this.dataset.id).expected= this.dataset.expected_size;
self.m.compute_normalization(this.dataset.id, this.dataset.expected_size)
self.m.update()
},
/* Fonction servant à "déverouiller" l'appel de la fonction compute_normalization(), ainsi qu'à apposer le 'check' au checkBox 'normalize'
* */
displayNormalizeButton: function() {
......
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