Files
KSP-MGA-Planner/dist/main/editor/sequence-selector.js
Krafpy 824af087c1 Modified file structure.
Modified the file structure to have the `index.html` at the root
of the repository. Needed for Github Pages.
2021-08-15 21:31:25 +02:00

21 lines
596 B
JavaScript

import { Selector } from "./selector.js";
export class SequenceSelector extends Selector {
constructor(id) {
super(id);
this.sequences = [];
}
fillFrom(sequences) {
this.sequences = sequences;
const strs = this.sequences.map(seq => seq.seqString);
this.fill(strs);
}
get sequence() {
const selectedString = this._selector.value;
for (const sequence of this.sequences) {
if (sequence.seqString == selectedString)
return sequence;
}
throw "Invalid sequence selection.";
}
}