Commit f938acda authored by Thonier Florian's avatar Thonier Florian
Browse files

model.js; make model.js more independant of view.

Warning view have a better update.
Some part of this update is also splitted and moved into list.js and aligner.js
parent c07423ec
Pipeline #732237 failed with stages
in 18 minutes and 40 seconds
......@@ -526,6 +526,14 @@ Aligner.prototype = {
}
var dom_content = this.m.clone(cloneID).getWarningsDom()
var info_align = document.getElementById(`aligner_info_${this.m.clone(cloneID).index}`)
if (info_align != null) {
info_align.classList = dom_content.className
info_align.firstChild.classList = dom_content.icon
info_align.firstChild.title = dom_content.title
}
this.updateDom(list)
.updateButton()
......
......@@ -546,6 +546,14 @@ List.prototype = {
if (this.m.clusters[cloneID].length < 2) display = false
document.getElementById("cluster"+cloneID).style.display = "none";
}
var info_list = document.getElementById(`clone_infoBox_${clone.index}`)
var dom_content = clone.getWarningsDom()
if (info_list != null) {
info_list.classList = dom_content.className
info_list.firstChild.classList = dom_content.icon
info_list.firstChild.title = dom_content.title
}
}
},
......
......@@ -1615,11 +1615,7 @@ changeAlleleNotation: function(alleleNotation, update, save) {
})
})
this.view.forEach( (view) => {
if (view.id == "warnings_list") {
view.update()
}
})
this.update()
console.default.log(`change warn level after; ${subwarn_code}, ${current_level}`)
},
......@@ -1629,9 +1625,7 @@ changeAlleleNotation: function(alleleNotation, update, save) {
*/
toogleWarningFilter: function(subwarn_code){
this.setWarningFilterStatus(subwarn_code, !this.getWarningFilterStatusFromCode(subwarn_code))
this.view.forEach( (view) => {
if (view.id == "warnings_list") {view.update()}
})
this.update()
},
/*
......@@ -1709,6 +1703,7 @@ changeAlleleNotation: function(alleleNotation, update, save) {
}
return false
},
/**
* Set the filter status of a warning by his warning code
* @param (string) warn_code The warning code to set
......
......@@ -296,21 +296,6 @@ Warnings.prototype = {
* update all content for list and data list
* */
update: function () {
m.clones.forEach( c =>{
var info_list = document.getElementById(`clone_infoBox_${c.index}`)
var info_align = document.getElementById(`aligner_info_${c.index}`)
var dom_content = c.getWarningsDom()
if (info_list != null) {
info_list.classList = dom_content.className
info_list.firstChild.classList = dom_content.icon
info_list.firstChild.title = dom_content.title
}
if (info_align != null) {
info_align.classList = dom_content.className
info_align.firstChild.classList = dom_content.icon
info_align.firstChild.title = dom_content.title
}
})
Object.keys(warnings_data).forEach( (category) => {
Object.keys(warnings_data[category]).forEach( (warn_code) => {
......
Supports Markdown
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