summaryrefslogtreecommitdiffstats
path: root/genome-list.mjs
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2021-02-19 20:11:23 -0500
committerBrian Cully <bjc@kublai.com>2021-02-19 20:11:23 -0500
commit6fc5f812561ecd556d185084e2b9a611c5b9ccd8 (patch)
tree315513fc7585fe1290e01a03320f473f7289a9af /genome-list.mjs
parentbdf1d88883256c0d2731600d604af22d27d8ee7f (diff)
downloadmolsim2-6fc5f812561ecd556d185084e2b9a611c5b9ccd8.tar.gz
molsim2-6fc5f812561ecd556d185084e2b9a611c5b9ccd8.zip
Add initial/final genome displays
Diffstat (limited to 'genome-list.mjs')
-rw-r--r--genome-list.mjs32
1 files changed, 29 insertions, 3 deletions
diff --git a/genome-list.mjs b/genome-list.mjs
index 8969a8c..ddb5361 100644
--- a/genome-list.mjs
+++ b/genome-list.mjs
@@ -1,13 +1,14 @@
class GenomeList {
constructor(elt) {
this.genomes = [];
- this.elt = elt;
+ this.elt = elt
}
push(genome) {
this.genomes.push(genome)
- this.elt.appendChild(genome.elt)
- window.genome = genome
+ const li = document.createElement('li')
+ li.appendChild(genome.elt)
+ this.historyElt.appendChild(li)
genome.elt.scrollIntoView(false)
}
@@ -18,6 +19,31 @@ class GenomeList {
return undefined
}
}
+
+ get historyElt() {
+ if (this._historyElt === undefined) {
+ this._historyElt = document.createElement('ol')
+ this.elt.querySelector('.history').appendChild(this._historyElt)
+ }
+ return this._historyElt
+ }
+
+ set initialGenome(genome) {
+ this.initialElt.appendChild(genome.elt)
+ }
+
+ set finalGenome(genome) {
+ this.finalElt.appendChild(genome.elt)
+ this.finalElt.classList.remove('hidden')
+ }
+
+ get initialElt() {
+ return this.elt.querySelector('.initial')
+ }
+
+ get finalElt() {
+ return this.elt.querySelector('.final')
+ }
}
export default GenomeList