Commit 640600ba authored by Marc Duez's avatar Marc Duez
Browse files

list.js / builder.js : factorize systembox builder

parent 99e34ce5
......@@ -645,23 +645,12 @@ Builder.prototype = {
m.update_selected_system()
}
var span_system = document.createElement('span')
var span_system = this.build_systemBox(key)
span_system.className = "systemBoxMenu";
/* TODO: factorize with list.js */
if ((typeof key != 'undefined') && (typeof germline.icon[key] != 'undefined')){
span_system.appendChild(document.createTextNode(germline.icon[key].letter));
span_system.style.background = germline.icon[key].color
span_system.title = key
}else{
span_system.appendChild(document.createTextNode("?"));
if (typeof key != 'undefined')
span_system.title = key ;
}
var span = document.createElement('span');
span.className = "systemBoxNameMenu";
span.appendChild(span_system)
span.appendChild(span_system)
span.appendChild(checkbox)
span.appendChild(document.createTextNode(key))
......@@ -674,6 +663,21 @@ Builder.prototype = {
return div
},
build_systemBox: function (system){
var span = document.createElement('span')
span.className = "systemBox";
if ((typeof system != 'undefined') && (typeof germline.icon[system] != 'undefined')){
span.appendChild(document.createTextNode(germline.icon[system].letter));
span.style.background = germline.icon[system].color
span.title = system
}else{
span.appendChild(document.createTextNode("?"));
if (typeof system != 'undefined')
span.title = system ;
}
return span
},
build_info_line: function (id, name, value, className) {
var span1 = document.createElement('span');
span1.appendChild(document.createTextNode(name + " : "));
......
......@@ -290,24 +290,12 @@ List.prototype = {
span_cluster.appendChild(document.createTextNode(' '));
}
if (this.m.system=="multi"){
var span_system = document.createElement('span')
var system = this.m.clone(cloneID).getSystem()
span_system.className = "systemBox";
if ((typeof system != 'undefined') && (typeof germline.icon[system] != 'undefined')){
span_system.appendChild(document.createTextNode(germline.icon[system].letter));
span_system.style.background = germline.icon[system].color
span_system.title = system
}else{
span_system.appendChild(document.createTextNode("?"));
if (typeof system != 'undefined')
span_system.title = system ;
}
}
div_elem.appendChild(span_cluster);
if (this.m.system=="multi") div_elem.appendChild(span_system);
if (this.m.system=="multi") {
var system = this.m.clone(cloneID).getSystem()
div_elem.appendChild(builder.build_systemBox(system));
}
div_elem.appendChild(span_name);
div_elem.appendChild(span_info);
div_elem.appendChild(span_star);
......
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